)]}'
{"ironic_python_agent/agent.py":[{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"075225b70f453f6d49b49ab4425e9acd364970ae","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                    raise errors.CommandExecutionError(\u0027agent is busy\u0027)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"            try:"},{"line_number":180,"context_line":"                results \u003d self.ext_mgr.map(_command_execute,"},{"line_number":181,"context_line":"                                          (extension_part, command_part),"},{"line_number":182,"context_line":"                                           **kwargs)"},{"line_number":183,"context_line":"            except errors.InvalidContentError as e:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAWH%2F%2BaFo%3D","line":180,"updated":"2014-03-27 00:59:05.000000000","message":"Since there will only ever be one extension for a given name, I think this could be simplified by just doing something like:\n\n    try:\n        ext \u003d self.ext_mgr[extension_part]\n    except KeyError:\n        # raise some error about extension not found\n    func \u003d getattr(ext.obj, command_part)\n    result \u003d func(**kwargs)\n\nThis also removes the need for the `_command_execute` function above, and the FIXME below.","commit_id":"3e2a712343c9bdcb100902bb1b4f41b234ec2c69"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"0b27bc9bbacac3dd2663572bd182363a57e8ed1c","unresolved":false,"context_lines":[{"line_number":172,"context_line":"                    raise errors.CommandExecutionError(\u0027agent is busy\u0027)"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                ext \u003d self.ext_mgr[extension_part.upper()]"},{"line_number":176,"context_line":"                result \u003d ext.execute(command_part, **kwargs)"},{"line_number":177,"context_line":"            except KeyError:"},{"line_number":178,"context_line":"                # Extension Not found"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BWhk%3D","line":175,"updated":"2014-03-27 13:06:56.000000000","message":"This shouldn\u0027t be upper-cased - the lookup should match what\u0027s in entry_points in setup.cfg. This only passed tests due to a bug that is also in the tests.\n\nAdditionally, you\u0027ll need to access the obj attribute of the extension - e.g. self.ext_mgr[extension_part].obj.","commit_id":"5ca1e2be7011eb3df6c4a94410b10e749f347bfc"},{"author":{"_account_id":8003,"name":"Aleksandr Gordeev","email":"agordeev@mirantis.com","username":"agordeev"},"change_message_id":"4e29ad3e01216fa3d6a68a75602a6307596e708a","unresolved":false,"context_lines":[{"line_number":172,"context_line":"                    raise errors.CommandExecutionError(\u0027agent is busy\u0027)"},{"line_number":173,"context_line":""},{"line_number":174,"context_line":"            try:"},{"line_number":175,"context_line":"                ext \u003d self.ext_mgr[extension_part.upper()]"},{"line_number":176,"context_line":"                result \u003d ext.execute(command_part, **kwargs)"},{"line_number":177,"context_line":"            except KeyError:"},{"line_number":178,"context_line":"                # Extension Not found"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BWQ8%3D","line":175,"in_reply_to":"AAAAWH%2F%2BWhk%3D","updated":"2014-03-27 13:31:37.000000000","message":"Done","commit_id":"5ca1e2be7011eb3df6c4a94410b10e749f347bfc"}],"ironic_python_agent/tests/agent.py":[{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"0b27bc9bbacac3dd2663572bd182363a57e8ed1c","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        fake_extension \u003d FakeExtension()"},{"line_number":150,"context_line":"        fake_extension.command_map[\u0027do_something\u0027] \u003d do_something_impl"},{"line_number":151,"context_line":"        self.agent.ext_mgr \u003d extension.ExtensionManager.\\"},{"line_number":152,"context_line":"            make_test_instance([fake_extension])"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        self.agent.execute_command(\u0027fake.do_something\u0027, foo\u003d\u0027bar\u0027)"},{"line_number":155,"context_line":"        do_something_impl.assert_called_once_with(\u0027do_something\u0027, foo\u003d\u0027bar\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BWgo%3D","line":152,"updated":"2014-03-27 13:06:56.000000000","message":"make_test_instance takes a list of stevedore.extension.Extension objects, not BaseAgentExtension objects. So you need to do something like: fake \u003d extension.Extension(\u0027fake\u0027, None, FakeExtension, fake_extension), and pass that into make_test_instance.\n\nThe reason why this happens to work here is that stevedore uses the \u0027name\u0027 attribute of the extensions to look up extensions, and fake_extension happens to have a \u0027name\u0027 attribute.","commit_id":"5ca1e2be7011eb3df6c4a94410b10e749f347bfc"},{"author":{"_account_id":8003,"name":"Aleksandr Gordeev","email":"agordeev@mirantis.com","username":"agordeev"},"change_message_id":"4e29ad3e01216fa3d6a68a75602a6307596e708a","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        fake_extension \u003d FakeExtension()"},{"line_number":150,"context_line":"        fake_extension.command_map[\u0027do_something\u0027] \u003d do_something_impl"},{"line_number":151,"context_line":"        self.agent.ext_mgr \u003d extension.ExtensionManager.\\"},{"line_number":152,"context_line":"            make_test_instance([fake_extension])"},{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        self.agent.execute_command(\u0027fake.do_something\u0027, foo\u003d\u0027bar\u0027)"},{"line_number":155,"context_line":"        do_something_impl.assert_called_once_with(\u0027do_something\u0027, foo\u003d\u0027bar\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F%2BWQ4%3D","line":152,"in_reply_to":"AAAAWH%2F%2BWgo%3D","updated":"2014-03-27 13:31:37.000000000","message":"Done","commit_id":"5ca1e2be7011eb3df6c4a94410b10e749f347bfc"}]}
