)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c250d4839a260bfaca412d4681a9e88fcbc0b406","unresolved":false,"context_lines":[{"line_number":13,"context_line":"As the bug states, I logged it as a critical failure and terminated"},{"line_number":14,"context_line":"the neutron server."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"I used RuntimeError, I wasn\u0027t sure if there was a more graceful way"},{"line_number":17,"context_line":"of exiting."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"[1] http://docs.openstack.org/developer/stevedore/managers.html"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa31d9ce_8f9eeb60","line":16,"updated":"2017-02-15 23:10:15.000000000","message":"If you want to exit an app, then raise SystemExit :)","commit_id":"f0ca2a92ae5b5ffdad89450c1f93581947032677"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"06af003ef03ea84c0991bc8b89db5df180fa7268","unresolved":false,"context_lines":[{"line_number":13,"context_line":"As the bug states, I logged it as a critical failure and terminated"},{"line_number":14,"context_line":"the neutron server."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"I used RuntimeError, I wasn\u0027t sure if there was a more graceful way"},{"line_number":17,"context_line":"of exiting."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"[1] http://docs.openstack.org/developer/stevedore/managers.html"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"fa31d9ce_72943e8a","line":16,"in_reply_to":"fa31d9ce_8f9eeb60","updated":"2017-02-15 23:42:08.000000000","message":"RuntimeError does stop the service from starting not sure which is better. I\u0027ll use SystemExit on the next patch.","commit_id":"f0ca2a92ae5b5ffdad89450c1f93581947032677"}],"neutron/plugins/ml2/managers.py":[{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"d81228565e4a52f5ca33205cdf92feef15e5ce9d","unresolved":false,"context_lines":[{"line_number":349,"context_line":"            \u0027neutron.ml2.mechanism_drivers\u0027,"},{"line_number":350,"context_line":"            cfg.CONF.ml2.mechanism_drivers,"},{"line_number":351,"context_line":"            invoke_on_load\u003dTrue,"},{"line_number":352,"context_line":"            name_order\u003dTrue,"},{"line_number":353,"context_line":"            on_missing_entrypoints_callback\u003dself._log_critical_and_exit"},{"line_number":354,"context_line":"        )"},{"line_number":355,"context_line":"        LOG.info(_LI(\"Loaded mechanism driver names: %s\"), self.names())"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_33b4c880","line":352,"updated":"2017-02-14 19:32:51.000000000","message":"What is the entry point was found but is faulty? Would registering \u0027on_load_failure_callback\u0027 as well help?","commit_id":"a104742fc47caece1d45647b898dec6df5b693cb"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"fa925e856774fad8b97d4798b7b9d1f8f00dc83e","unresolved":false,"context_lines":[{"line_number":349,"context_line":"            \u0027neutron.ml2.mechanism_drivers\u0027,"},{"line_number":350,"context_line":"            cfg.CONF.ml2.mechanism_drivers,"},{"line_number":351,"context_line":"            invoke_on_load\u003dTrue,"},{"line_number":352,"context_line":"            name_order\u003dTrue,"},{"line_number":353,"context_line":"            on_missing_entrypoints_callback\u003dself._log_critical_and_exit"},{"line_number":354,"context_line":"        )"},{"line_number":355,"context_line":"        LOG.info(_LI(\"Loaded mechanism driver names: %s\"), self.names())"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_fec83724","line":352,"in_reply_to":"fa31d9ce_33b4c880","updated":"2017-02-14 20:01:57.000000000","message":"I think so, do we have any faulty drivers we can test with? I added the code but it\u0027s not tested at the moment.","commit_id":"a104742fc47caece1d45647b898dec6df5b693cb"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"37db008e25deef52bf37f100451e8353d6041f0c","unresolved":false,"context_lines":[{"line_number":349,"context_line":"            \u0027neutron.ml2.mechanism_drivers\u0027,"},{"line_number":350,"context_line":"            cfg.CONF.ml2.mechanism_drivers,"},{"line_number":351,"context_line":"            invoke_on_load\u003dTrue,"},{"line_number":352,"context_line":"            name_order\u003dTrue,"},{"line_number":353,"context_line":"            on_missing_entrypoints_callback\u003dself._log_critical_and_exit"},{"line_number":354,"context_line":"        )"},{"line_number":355,"context_line":"        LOG.info(_LI(\"Loaded mechanism driver names: %s\"), self.names())"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_3fb9e679","line":352,"in_reply_to":"fa31d9ce_fec83724","updated":"2017-02-14 22:59:18.000000000","message":"You\u0027d have to add a dummy, test-only flawed driver.","commit_id":"a104742fc47caece1d45647b898dec6df5b693cb"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"d81228565e4a52f5ca33205cdf92feef15e5ce9d","unresolved":false,"context_lines":[{"line_number":360,"context_line":"                         \"information for agent scheduling.\"))"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"    def _log_critical_and_exit(self, names):"},{"line_number":363,"context_line":"        msg \u003d _(\"Could not load mechanism driver names %s\") % names"},{"line_number":364,"context_line":"        LOG.critical(msg)"},{"line_number":365,"context_line":"        raise RuntimeError(msg)"},{"line_number":366,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_339da80a","line":363,"updated":"2017-02-14 19:32:51.000000000","message":"From the stevedore docs, it looks like on_missing_entrypoints_callback is called when the entry point is missing entirely. It\u0027d be worthwhile to make the error message here more explicit, stating that the mechanism driver was not found.","commit_id":"a104742fc47caece1d45647b898dec6df5b693cb"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"fa925e856774fad8b97d4798b7b9d1f8f00dc83e","unresolved":false,"context_lines":[{"line_number":360,"context_line":"                         \"information for agent scheduling.\"))"},{"line_number":361,"context_line":""},{"line_number":362,"context_line":"    def _log_critical_and_exit(self, names):"},{"line_number":363,"context_line":"        msg \u003d _(\"Could not load mechanism driver names %s\") % names"},{"line_number":364,"context_line":"        LOG.critical(msg)"},{"line_number":365,"context_line":"        raise RuntimeError(msg)"},{"line_number":366,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"fa31d9ce_dee0d398","line":363,"in_reply_to":"fa31d9ce_339da80a","updated":"2017-02-14 20:01:57.000000000","message":"Done","commit_id":"a104742fc47caece1d45647b898dec6df5b693cb"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"c250d4839a260bfaca412d4681a9e88fcbc0b406","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        LOG.critical(msg)"},{"line_number":367,"context_line":"        raise RuntimeError(msg)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _driver_not_loaded(self, manager, entrypoint, exception):"},{"line_number":370,"context_line":"        msg \u003d (_(\"The \u0027%(entrypoint)s\u0027 entrypoint could not be\""},{"line_number":371,"context_line":"                 \" loaded for the following reason: \u0027%(reason)s\u0027.\")"},{"line_number":372,"context_line":"                 % {\u0027entrypoint\u0027: entrypoint,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_efa687bf","line":369,"updated":"2017-02-15 23:10:15.000000000","message":"you should delegate msg formatting to LOG.critical:\n\n LOG.critical(_LC(\u0027..\u0027), entrypoint\u003d..., reason\u003d...)","commit_id":"f0ca2a92ae5b5ffdad89450c1f93581947032677"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"af65060eae0f5a87bcd46460e3252f6722b69041","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        LOG.critical(msg)"},{"line_number":367,"context_line":"        raise RuntimeError(msg)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _driver_not_loaded(self, manager, entrypoint, exception):"},{"line_number":370,"context_line":"        msg \u003d (_(\"The \u0027%(entrypoint)s\u0027 entrypoint could not be\""},{"line_number":371,"context_line":"                 \" loaded for the following reason: \u0027%(reason)s\u0027.\")"},{"line_number":372,"context_line":"                 % {\u0027entrypoint\u0027: entrypoint,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_d2916a48","line":369,"in_reply_to":"fa31d9ce_12406206","updated":"2017-02-15 23:51:51.000000000","message":"The main point is that the following:\n \n msg \u003d _(\u0027...\u0027) % kwargs\n LOG.critical(msg)\n\nshould be replaced by:\n\n msg \u003d _(\u0027...\u0027)\n LOG.critical(msg, **kwargs)\n\n\nMoreover there is no reason to define msg because it\u0027s used only in LOG.critical so it becomes:\n\n LOG.critical(_LC(\u0027...\u0027), **kwargs)","commit_id":"f0ca2a92ae5b5ffdad89450c1f93581947032677"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"5b62f452107b03369267d01c7d87a61b26228be8","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        LOG.critical(msg)"},{"line_number":367,"context_line":"        raise RuntimeError(msg)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _driver_not_loaded(self, manager, entrypoint, exception):"},{"line_number":370,"context_line":"        msg \u003d (_(\"The \u0027%(entrypoint)s\u0027 entrypoint could not be\""},{"line_number":371,"context_line":"                 \" loaded for the following reason: \u0027%(reason)s\u0027.\")"},{"line_number":372,"context_line":"                 % {\u0027entrypoint\u0027: entrypoint,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_96f8a94b","line":369,"in_reply_to":"fa31d9ce_d2916a48","updated":"2017-02-16 14:07:47.000000000","message":"Right, when I wrote that comment I was looking at the code above.","commit_id":"f0ca2a92ae5b5ffdad89450c1f93581947032677"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"06af003ef03ea84c0991bc8b89db5df180fa7268","unresolved":false,"context_lines":[{"line_number":366,"context_line":"        LOG.critical(msg)"},{"line_number":367,"context_line":"        raise RuntimeError(msg)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _driver_not_loaded(self, manager, entrypoint, exception):"},{"line_number":370,"context_line":"        msg \u003d (_(\"The \u0027%(entrypoint)s\u0027 entrypoint could not be\""},{"line_number":371,"context_line":"                 \" loaded for the following reason: \u0027%(reason)s\u0027.\")"},{"line_number":372,"context_line":"                 % {\u0027entrypoint\u0027: entrypoint,"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_12406206","line":369,"in_reply_to":"fa31d9ce_efa687bf","updated":"2017-02-15 23:42:08.000000000","message":"I was following the guidelines here https://docs.openstack.org/developer/oslo.i18n/guidelines.html#choosing-a-marker-function\n\nI\u0027m not sure if this example is just showing to not use marker functions in exceptions or both but what you\u0027re saying is to translate the message twice once for formatting in the logs and one for not?\n\n\u003e # WRONG\nmsg \u003d _LE(\u0027There was an error.\u0027)\nLOG.exception(msg)\nraise LocalExceptionClass(msg)\n\n\u003e # RIGHT\nmsg \u003d _(\u0027There was an error.\u0027)\nLOG.exception(msg)\nraise LocalExceptionClass(msg)","commit_id":"f0ca2a92ae5b5ffdad89450c1f93581947032677"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6b27b7ca7655b3281bfe10682d79d42fbd177136","unresolved":false,"context_lines":[{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _driver_not_loaded(self, manager, entrypoint, exception):"},{"line_number":370,"context_line":"        LOG.critical(_LC(\"The \u0027%(entrypoint)s\u0027 entrypoint could not be\""},{"line_number":371,"context_line":"                         \" loaded for the following reason: \u0027%(reason)s\u0027.\")"},{"line_number":372,"context_line":"                     % {\u0027entrypoint\u0027: entrypoint,"},{"line_number":373,"context_line":"                        \u0027reason\u0027: exception.message})"},{"line_number":374,"context_line":"        raise SystemExit(exception.message)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa31d9ce_986b7785","line":371,"updated":"2017-02-16 14:11:39.000000000","message":"it should be:\n\n LOG.critical(_LC(...), entrypoint\u003d..., reason\u003d...)","commit_id":"14190c4831be43c24ad9e97b9a3a62c449dd81e2"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"d1deb9d129ca90d6d4ccea9db63c89ad134b8d5c","unresolved":false,"context_lines":[{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _driver_not_loaded(self, manager, entrypoint, exception):"},{"line_number":370,"context_line":"        LOG.critical(_LC(\"The \u0027%(entrypoint)s\u0027 entrypoint could not be\""},{"line_number":371,"context_line":"                         \" loaded for the following reason: \u0027%(reason)s\u0027.\")"},{"line_number":372,"context_line":"                     % {\u0027entrypoint\u0027: entrypoint,"},{"line_number":373,"context_line":"                        \u0027reason\u0027: exception.message})"},{"line_number":374,"context_line":"        raise SystemExit(exception.message)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa31d9ce_27afc295","line":371,"in_reply_to":"fa31d9ce_986b7785","updated":"2017-02-16 15:49:17.000000000","message":"yeah use comma instead of %","commit_id":"14190c4831be43c24ad9e97b9a3a62c449dd81e2"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"0e32ff3cd7ef4714e22e78892e8a20772aa862e1","unresolved":false,"context_lines":[{"line_number":361,"context_line":"                         \"information for agent scheduling.\"))"},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"    def _driver_not_found(self, names):"},{"line_number":364,"context_line":"        msg \u003d (_(\"The following mechanism drivers were not found: %s\")"},{"line_number":365,"context_line":"               % names)"},{"line_number":366,"context_line":"        LOG.critical(msg)"},{"line_number":367,"context_line":"        raise SystemExit(msg)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _driver_not_loaded(self, manager, entrypoint, exception):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a30ddce_ad5b402d","line":366,"range":{"start_line":364,"start_character":0,"end_line":366,"end_character":25},"updated":"2017-03-08 22:26:31.000000000","message":"Is there a reason not to delegate the formatting of the error message to LOG.critical, like below in L370?","commit_id":"9e60c9429aeea1f18481bb67e12d52d62be4d8e4"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"d01f4c723ad18b05f454beabdc88fb43138d938b","unresolved":false,"context_lines":[{"line_number":361,"context_line":"                         \"information for agent scheduling.\"))"},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"    def _driver_not_found(self, names):"},{"line_number":364,"context_line":"        msg \u003d (_(\"The following mechanism drivers were not found: %s\")"},{"line_number":365,"context_line":"               % names)"},{"line_number":366,"context_line":"        LOG.critical(msg)"},{"line_number":367,"context_line":"        raise SystemExit(msg)"},{"line_number":368,"context_line":""},{"line_number":369,"context_line":"    def _driver_not_loaded(self, manager, entrypoint, exception):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a30ddce_2d0030aa","line":366,"range":{"start_line":364,"start_character":0,"end_line":366,"end_character":25},"in_reply_to":"9a30ddce_ad5b402d","updated":"2017-03-08 22:36:54.000000000","message":"because msg is also used when raising SystemExit","commit_id":"9e60c9429aeea1f18481bb67e12d52d62be4d8e4"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"d01f4c723ad18b05f454beabdc88fb43138d938b","unresolved":false,"context_lines":[{"line_number":370,"context_line":"        LOG.critical(_LC(\"The \u0027%(entrypoint)s\u0027 entrypoint could not be\""},{"line_number":371,"context_line":"                         \" loaded for the following reason: \u0027%(reason)s\u0027.\"),"},{"line_number":372,"context_line":"                     {\u0027entrypoint\u0027: entrypoint,"},{"line_number":373,"context_line":"                      \u0027reason\u0027: str(exception)})"},{"line_number":374,"context_line":"        raise SystemExit(str(exception))"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    def _register_mechanisms(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a30ddce_8dde7c3d","line":373,"updated":"2017-03-08 22:36:54.000000000","message":"replace str(exception) by exception because %s already call exception.__str__()","commit_id":"9e60c9429aeea1f18481bb67e12d52d62be4d8e4"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"f73706927e461eff9edf15254ff548e86f4fc4af","unresolved":false,"context_lines":[{"line_number":370,"context_line":"        LOG.critical(_LC(\"The \u0027%(entrypoint)s\u0027 entrypoint could not be\""},{"line_number":371,"context_line":"                         \" loaded for the following reason: \u0027%(reason)s\u0027.\"),"},{"line_number":372,"context_line":"                     {\u0027entrypoint\u0027: entrypoint,"},{"line_number":373,"context_line":"                      \u0027reason\u0027: str(exception)})"},{"line_number":374,"context_line":"        raise SystemExit(str(exception))"},{"line_number":375,"context_line":""},{"line_number":376,"context_line":"    def _register_mechanisms(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a30ddce_71a90890","line":373,"in_reply_to":"9a30ddce_8dde7c3d","updated":"2017-03-09 14:28:24.000000000","message":"Done","commit_id":"9e60c9429aeea1f18481bb67e12d52d62be4d8e4"}],"neutron/tests/unit/plugins/ml2/drivers/mech_fake_agent.py":[{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2109c96b3065412df374ec22ffb4df4c4e0c1263","unresolved":false,"context_lines":[{"line_number":62,"context_line":"    def get_mappings(self, agent):"},{"line_number":63,"context_line":"        return dict(agent[\u0027configurations\u0027].get(\u0027interface_mappings\u0027, {}))"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"class FaultyAgentMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):"},{"line_number":67,"context_line":"    \"\"\"ML2 mechanism driver for testing of handlers for faulty drivers"},{"line_number":68,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_08517fd8","line":65,"updated":"2017-02-22 19:54:54.000000000","message":"This file is for kaef agent. You should create a faulty agent file","commit_id":"d01abb5a42f56f0f0948b84bb8967d90463d9ad3"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2109c96b3065412df374ec22ffb4df4c4e0c1263","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        return dict(agent[\u0027configurations\u0027].get(\u0027interface_mappings\u0027, {}))"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"class FaultyAgentMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):"},{"line_number":67,"context_line":"    \"\"\"ML2 mechanism driver for testing of handlers for faulty drivers"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    The purpose of this class is to test the ml2 plugin manager handlers for"}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_483e178d","line":66,"range":{"start_line":66,"start_character":0,"end_line":66,"end_character":76},"updated":"2017-02-22 19:54:54.000000000","message":"The class loading is failing because you are not implementing get_allowed_network_types and get_mappings. Ok, that\u0027s correct: it\u0027s a faulty agent. But, instead of this, why don\u0027t you implement those functions and, during the init, you raise an Exception??\n\n    def __init__(self):\n        raise Exception(\"Life is hard\")\n        pass\n\n    def get_allowed_network_types(self, agent):\n        pass\n\n    def get_mappings(self, agent):\n        pass","commit_id":"d01abb5a42f56f0f0948b84bb8967d90463d9ad3"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"c3cbbd3350d694a5409e6f939b1df006779c50ba","unresolved":false,"context_lines":[{"line_number":63,"context_line":"        return dict(agent[\u0027configurations\u0027].get(\u0027interface_mappings\u0027, {}))"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"class FaultyAgentMechanismDriver(mech_agent.SimpleAgentMechanismDriverBase):"},{"line_number":67,"context_line":"    \"\"\"ML2 mechanism driver for testing of handlers for faulty drivers"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    The purpose of this class is to test the ml2 plugin manager handlers for"}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_77c39757","line":66,"range":{"start_line":66,"start_character":0,"end_line":66,"end_character":76},"in_reply_to":"da36d5c6_483e178d","updated":"2017-02-23 17:43:16.000000000","message":"Yeah that would be more clear.","commit_id":"d01abb5a42f56f0f0948b84bb8967d90463d9ad3"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2109c96b3065412df374ec22ffb4df4c4e0c1263","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    \"\"\"ML2 mechanism driver for testing of handlers for faulty drivers"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    The purpose of this class is to test the ml2 plugin manager handlers for"},{"line_number":70,"context_line":"    on_load_failure_callback and on_missing_entrypoints_callback parameters"},{"line_number":71,"context_line":"    provided by the stevedore.named.NamedExtensionManager class."},{"line_number":72,"context_line":"    \"\"\""},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_bc719d78","line":70,"range":{"start_line":70,"start_character":33,"end_line":70,"end_character":64},"updated":"2017-02-22 19:54:54.000000000","message":"This class is not used to test a missing entry point. Am I right?","commit_id":"d01abb5a42f56f0f0948b84bb8967d90463d9ad3"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"c3cbbd3350d694a5409e6f939b1df006779c50ba","unresolved":false,"context_lines":[{"line_number":67,"context_line":"    \"\"\"ML2 mechanism driver for testing of handlers for faulty drivers"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    The purpose of this class is to test the ml2 plugin manager handlers for"},{"line_number":70,"context_line":"    on_load_failure_callback and on_missing_entrypoints_callback parameters"},{"line_number":71,"context_line":"    provided by the stevedore.named.NamedExtensionManager class."},{"line_number":72,"context_line":"    \"\"\""},{"line_number":73,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_b7c0af51","line":70,"range":{"start_line":70,"start_character":33,"end_line":70,"end_character":64},"in_reply_to":"da36d5c6_bc719d78","updated":"2017-02-23 17:43:16.000000000","message":"Right","commit_id":"d01abb5a42f56f0f0948b84bb8967d90463d9ad3"}],"neutron/tests/unit/plugins/ml2/drivers/mech_faulty_agent.py":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"d01f4c723ad18b05f454beabdc88fb43138d938b","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def __init__(self):"},{"line_number":32,"context_line":"        raise Exception(\"Using a faulty driver for testing purposes.\")"},{"line_number":33,"context_line":"        pass"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def get_allowed_network_types(self, agent):"},{"line_number":36,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a30ddce_2dee70ec","line":33,"updated":"2017-03-08 22:36:54.000000000","message":"l33 is useless and unreachable","commit_id":"9e60c9429aeea1f18481bb67e12d52d62be4d8e4"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"f73706927e461eff9edf15254ff548e86f4fc4af","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    def __init__(self):"},{"line_number":32,"context_line":"        raise Exception(\"Using a faulty driver for testing purposes.\")"},{"line_number":33,"context_line":"        pass"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def get_allowed_network_types(self, agent):"},{"line_number":36,"context_line":"        pass"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a30ddce_91ae7c96","line":33,"in_reply_to":"9a30ddce_2dee70ec","updated":"2017-03-09 14:28:24.000000000","message":"Done","commit_id":"9e60c9429aeea1f18481bb67e12d52d62be4d8e4"}],"neutron/tests/unit/plugins/ml2/test_managers.py":[{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"6b27b7ca7655b3281bfe10682d79d42fbd177136","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_found\u0027)"},{"line_number":46,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_loaded\u0027)"},{"line_number":47,"context_line":"    def test__driver_not_found(self, mock_not_loaded, mock_not_found):"},{"line_number":48,"context_line":"        config.cfg.CONF.set_override(\u0027mechanism_drivers\u0027, [\u0027invalidmech\u0027],"},{"line_number":49,"context_line":"                                     group\u003d\u0027ml2\u0027)"},{"line_number":50,"context_line":"        managers.MechanismManager()"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa31d9ce_f88b931c","line":47,"updated":"2017-02-16 14:11:39.000000000","message":"Current test checks stevedore code not _driver_not_found/loaded!\n\nit should be:\n\n @mock.patch.object(managers.MechanismManager, \u0027_driver_not_loaded\u0027)\n def test_...\n   ...\n   self.assertRaises(SystemExit, managers.MechanismManager)","commit_id":"14190c4831be43c24ad9e97b9a3a62c449dd81e2"},{"author":{"_account_id":8124,"name":"cbrandily","email":"zzelle@gmail.com","username":"cbrandily"},"change_message_id":"18eb203bc2eaf61b36f46979604cb5e47bb009b2","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_found\u0027)"},{"line_number":46,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_loaded\u0027)"},{"line_number":47,"context_line":"    def test__driver_not_found(self, mock_not_loaded, mock_not_found):"},{"line_number":48,"context_line":"        config.cfg.CONF.set_override(\u0027mechanism_drivers\u0027, [\u0027invalidmech\u0027],"},{"line_number":49,"context_line":"                                     group\u003d\u0027ml2\u0027)"},{"line_number":50,"context_line":"        managers.MechanismManager()"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa31d9ce_52e63617","line":47,"in_reply_to":"fa31d9ce_47e67617","updated":"2017-02-16 16:13:51.000000000","message":"No, 2 tests are enough:\n\n  @mock.patch.object(managers.MechanismManager, \u0027_driver_not_loaded\u0027)\n  def test_driver_not_found(self, mock_not_loaded):\n    self.assertRaises(SystemExit, managers.MechanismManager)\n    mock_not_loaded.assert_not_called()","commit_id":"14190c4831be43c24ad9e97b9a3a62c449dd81e2"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"5a2be888980154ef199735426c2d4792ef774873","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_found\u0027)"},{"line_number":46,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_loaded\u0027)"},{"line_number":47,"context_line":"    def test__driver_not_found(self, mock_not_loaded, mock_not_found):"},{"line_number":48,"context_line":"        config.cfg.CONF.set_override(\u0027mechanism_drivers\u0027, [\u0027invalidmech\u0027],"},{"line_number":49,"context_line":"                                     group\u003d\u0027ml2\u0027)"},{"line_number":50,"context_line":"        managers.MechanismManager()"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa31d9ce_9f919655","line":47,"in_reply_to":"fa31d9ce_52e63617","updated":"2017-02-16 16:56:10.000000000","message":"Done. I also added assert calls for the logs.","commit_id":"14190c4831be43c24ad9e97b9a3a62c449dd81e2"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"d1deb9d129ca90d6d4ccea9db63c89ad134b8d5c","unresolved":false,"context_lines":[{"line_number":44,"context_line":""},{"line_number":45,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_found\u0027)"},{"line_number":46,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_loaded\u0027)"},{"line_number":47,"context_line":"    def test__driver_not_found(self, mock_not_loaded, mock_not_found):"},{"line_number":48,"context_line":"        config.cfg.CONF.set_override(\u0027mechanism_drivers\u0027, [\u0027invalidmech\u0027],"},{"line_number":49,"context_line":"                                     group\u003d\u0027ml2\u0027)"},{"line_number":50,"context_line":"        managers.MechanismManager()"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa31d9ce_47e67617","line":47,"in_reply_to":"fa31d9ce_f88b931c","updated":"2017-02-16 15:49:17.000000000","message":"I think I should use testtools.ExpectedException for Fatal exceptions that way the tests can keep running. I can\u0027t assert the functions are called without mocking them.\n\nAre you saying I should write another test so that I can assert the logs and exceptions are performed and thrown? I didn\u0027t think that was necessary as its the only case for the function. I guess it can\u0027t hurt.","commit_id":"14190c4831be43c24ad9e97b9a3a62c449dd81e2"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2109c96b3065412df374ec22ffb4df4c4e0c1263","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                                     group\u003d\u0027ml2\u0027)"},{"line_number":50,"context_line":"        self.assertRaises(SystemExit, managers.MechanismManager)"},{"line_number":51,"context_line":"        mock_not_loaded.assert_not_called()"},{"line_number":52,"context_line":"        mock_log.assert_called_once_with(mock.ANY)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    @mock.patch.object(managers.LOG, \u0027critical\u0027)"},{"line_number":55,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_found\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_f92a478f","line":52,"range":{"start_line":52,"start_character":41,"end_line":52,"end_character":49},"updated":"2017-02-22 19:54:54.000000000","message":"You can check the string message, instead of mocking the value","commit_id":"d01abb5a42f56f0f0948b84bb8967d90463d9ad3"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"c3cbbd3350d694a5409e6f939b1df006779c50ba","unresolved":false,"context_lines":[{"line_number":49,"context_line":"                                     group\u003d\u0027ml2\u0027)"},{"line_number":50,"context_line":"        self.assertRaises(SystemExit, managers.MechanismManager)"},{"line_number":51,"context_line":"        mock_not_loaded.assert_not_called()"},{"line_number":52,"context_line":"        mock_log.assert_called_once_with(mock.ANY)"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    @mock.patch.object(managers.LOG, \u0027critical\u0027)"},{"line_number":55,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_found\u0027)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_f7df8737","line":52,"range":{"start_line":52,"start_character":41,"end_line":52,"end_character":49},"in_reply_to":"da36d5c6_f92a478f","updated":"2017-02-23 17:43:16.000000000","message":"I\u0027ll have to look at six because the string representation is formatted differently for the collection.","commit_id":"d01abb5a42f56f0f0948b84bb8967d90463d9ad3"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2109c96b3065412df374ec22ffb4df4c4e0c1263","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    @mock.patch.object(managers.LOG, \u0027critical\u0027)"},{"line_number":55,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_found\u0027)"},{"line_number":56,"context_line":"    def test__driver_not_loaded(self, mock_not_found, mock_log):"},{"line_number":57,"context_line":"        config.cfg.CONF.set_override(\u0027mechanism_drivers\u0027, [\u0027faulty_agent\u0027],"},{"line_number":58,"context_line":"                                     group\u003d\u0027ml2\u0027)"},{"line_number":59,"context_line":"        self.assertRaises(SystemExit, managers.MechanismManager)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_3c3e8d8c","line":56,"range":{"start_line":56,"start_character":38,"end_line":56,"end_character":52},"updated":"2017-02-22 19:54:54.000000000","message":"Also you can check this function is not called.","commit_id":"d01abb5a42f56f0f0948b84bb8967d90463d9ad3"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"c3cbbd3350d694a5409e6f939b1df006779c50ba","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    @mock.patch.object(managers.LOG, \u0027critical\u0027)"},{"line_number":55,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_found\u0027)"},{"line_number":56,"context_line":"    def test__driver_not_loaded(self, mock_not_found, mock_log):"},{"line_number":57,"context_line":"        config.cfg.CONF.set_override(\u0027mechanism_drivers\u0027, [\u0027faulty_agent\u0027],"},{"line_number":58,"context_line":"                                     group\u003d\u0027ml2\u0027)"},{"line_number":59,"context_line":"        self.assertRaises(SystemExit, managers.MechanismManager)"}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_b7d98f59","line":56,"range":{"start_line":56,"start_character":38,"end_line":56,"end_character":52},"in_reply_to":"da36d5c6_3c3e8d8c","updated":"2017-02-23 17:43:16.000000000","message":"It actually is called.","commit_id":"d01abb5a42f56f0f0948b84bb8967d90463d9ad3"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"2109c96b3065412df374ec22ffb4df4c4e0c1263","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        config.cfg.CONF.set_override(\u0027mechanism_drivers\u0027, [\u0027faulty_agent\u0027],"},{"line_number":58,"context_line":"                                     group\u003d\u0027ml2\u0027)"},{"line_number":59,"context_line":"        self.assertRaises(SystemExit, managers.MechanismManager)"},{"line_number":60,"context_line":"        mock_log.assert_called_once_with(mock.ANY, mock.ANY)"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"class TestMechManager(base.BaseTestCase):"}],"source_content_type":"text/x-python","patch_set":7,"id":"da36d5c6_391f7f6d","line":60,"range":{"start_line":60,"start_character":41,"end_line":60,"end_character":59},"updated":"2017-02-22 19:54:54.000000000","message":"ditto","commit_id":"d01abb5a42f56f0f0948b84bb8967d90463d9ad3"},{"author":{"_account_id":20378,"name":"Trevor McCasland","email":"TM2086@att.com","username":"twm2016"},"change_message_id":"1aaa3a5d0e6efbb7c7a0ea56b3434154f5991d3d","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        mock_not_loaded.assert_not_called()"},{"line_number":52,"context_line":"        mock_log.assert_called_once_with(\"The following mechanism drivers \""},{"line_number":53,"context_line":"                                         \"were not found: %s\""},{"line_number":54,"context_line":"                                         % set([\u0027invalidmetManagersh\u0027]))"},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"    @mock.patch.object(managers.LOG, \u0027critical\u0027)"},{"line_number":57,"context_line":"    @mock.patch.object(managers.MechanismManager, \u0027_driver_not_found\u0027)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a30ddce_e846aa79","line":54,"range":{"start_line":54,"start_character":59,"end_line":54,"end_character":68},"updated":"2017-03-10 18:57:44.000000000","message":"huh? not sure how that got there..","commit_id":"2afcdebe63aa159e5b2635b311f76616f19d5393"}]}
