)]}'
{"oslo_config/generator.py":[{"author":{"_account_id":2813,"name":"Mehdi Abaakouk","email":"sileht@sileht.net","username":"sileht"},"change_message_id":"5e3f1c85c09011502a2ea2a17b4ea5dd57b5ff5e","unresolved":false,"context_lines":[{"line_number":264,"context_line":"def on_load_failure_callback(manager, ep, exc):"},{"line_number":265,"context_line":"    msg \u003d \"Failed to load entry point \u0027%(ep)s\u0027, error: %(err)s\" % {"},{"line_number":266,"context_line":"        \u0027ep\u0027: ep, \u0027err\u0027: exc}"},{"line_number":267,"context_line":"    sys.exit(msg)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"def generate(conf):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_0099ef1e","line":267,"updated":"2015-02-10 14:13:00.000000000","message":"I think it\u0027s better to keep the entire backtrace to understand what is wrong, this should be sufficient:\n\n    def on_load_failure_callback(manager, ep, exc):\n        raise\n\nOr if we want use logging, we can do:\n\n    def on_load_failure_callback(manager, ep, exc):\n        LOG.exception(\"Failed to load entry point \u0027%s\u0027\" % ep)\n        sys.exit(1)","commit_id":"85df445f7c85ab490dbb2990c36c7b24e58474fd"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"92fcf0614fe54b182d839af3821fb2275106e584","unresolved":false,"context_lines":[{"line_number":264,"context_line":"def on_load_failure_callback(manager, ep, exc):"},{"line_number":265,"context_line":"    msg \u003d \"Failed to load entry point \u0027%(ep)s\u0027, error: %(err)s\" % {"},{"line_number":266,"context_line":"        \u0027ep\u0027: ep, \u0027err\u0027: exc}"},{"line_number":267,"context_line":"    sys.exit(msg)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":""},{"line_number":270,"context_line":"def generate(conf):"}],"source_content_type":"text/x-python","patch_set":1,"id":"da86d52c_dbec292c","line":267,"in_reply_to":"da86d52c_0099ef1e","updated":"2015-02-10 14:28:20.000000000","message":"Done","commit_id":"85df445f7c85ab490dbb2990c36c7b24e58474fd"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"327038facb24ea63ffcb48b157cd834cb6468a0c","unresolved":false,"context_lines":[{"line_number":260,"context_line":"    mgr \u003d stevedore.named.NamedExtensionManager("},{"line_number":261,"context_line":"        \u0027oslo.config.opts\u0027,"},{"line_number":262,"context_line":"        names\u003dnamespaces,"},{"line_number":263,"context_line":"        on_load_failure_callback\u003don_load_failure_callback,"},{"line_number":264,"context_line":"        invoke_on_load\u003dTrue)"},{"line_number":265,"context_line":"    return [(ep.name, ep.obj) for ep in mgr]"},{"line_number":266,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_66a24baf","line":263,"updated":"2015-02-19 20:14:40.000000000","message":"Do we actually need to use the callback, or can we just set propagate_map_exceptions\u003dTrue?  It looks like that\u0027s the reason the exception was logged and ignored: http://docs.openstack.org/developer/stevedore/managers.html#stevedore.named.NamedExtensionManager","commit_id":"2e020ccfda9a4e5817410ad8443b77ab61bcce88"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"e1adb3da2c407b79d7a6a29c18cb656b79a8bc7a","unresolved":false,"context_lines":[{"line_number":260,"context_line":"    mgr \u003d stevedore.named.NamedExtensionManager("},{"line_number":261,"context_line":"        \u0027oslo.config.opts\u0027,"},{"line_number":262,"context_line":"        names\u003dnamespaces,"},{"line_number":263,"context_line":"        on_load_failure_callback\u003don_load_failure_callback,"},{"line_number":264,"context_line":"        invoke_on_load\u003dTrue)"},{"line_number":265,"context_line":"    return [(ep.name, ep.obj) for ep in mgr]"},{"line_number":266,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_7fc00ee0","line":263,"in_reply_to":"da86d52c_66a24baf","updated":"2015-02-19 23:09:48.000000000","message":"\"propagate_map_exceptions\" is used for method \"map\" that uses already existed instances of extensions. In our case we get error trying instantiate extension. So, handling point of \"propagate_map_exceptions\" is just not reached. Hence, I leave approach with \"callback\" as is.","commit_id":"2e020ccfda9a4e5817410ad8443b77ab61bcce88"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"c966a61b7b3fc6916e1d9415a943d84132e0c789","unresolved":false,"context_lines":[{"line_number":260,"context_line":"    mgr \u003d stevedore.named.NamedExtensionManager("},{"line_number":261,"context_line":"        \u0027oslo.config.opts\u0027,"},{"line_number":262,"context_line":"        names\u003dnamespaces,"},{"line_number":263,"context_line":"        on_load_failure_callback\u003don_load_failure_callback,"},{"line_number":264,"context_line":"        invoke_on_load\u003dTrue)"},{"line_number":265,"context_line":"    return [(ep.name, ep.obj) for ep in mgr]"},{"line_number":266,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_fff83ce7","line":263,"in_reply_to":"da86d52c_7fc00ee0","updated":"2015-02-20 20:57:08.000000000","message":"Okay, sounds good.  I just noticed that when I was looking up the docs on the callback.","commit_id":"2e020ccfda9a4e5817410ad8443b77ab61bcce88"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"c966a61b7b3fc6916e1d9415a943d84132e0c789","unresolved":false,"context_lines":[{"line_number":269,"context_line":"    LOG.exception("},{"line_number":270,"context_line":"        \"Failed to load entry point \u0027%(ep)s\u0027, error: %(error)s\","},{"line_number":271,"context_line":"        {\u0027ep\u0027: ep, \u0027error\u0027: exc})"},{"line_number":272,"context_line":"    sys.exit(1)"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"def generate(conf):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_ffb59ccd","line":272,"updated":"2015-02-20 20:57:08.000000000","message":"Okay, the above being the case, I\u0027m not sure we want to sys.exit here.  That\u0027s going to make this difficult to test.  Can we just raise an exception with the details of the log message, or will that get caught too?","commit_id":"2e020ccfda9a4e5817410ad8443b77ab61bcce88"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"f1c92b7f976c37ef04e5e0eb44ca4ee5032754f4","unresolved":false,"context_lines":[{"line_number":269,"context_line":"    LOG.exception("},{"line_number":270,"context_line":"        \"Failed to load entry point \u0027%(ep)s\u0027, error: %(error)s\","},{"line_number":271,"context_line":"        {\u0027ep\u0027: ep, \u0027error\u0027: exc})"},{"line_number":272,"context_line":"    sys.exit(1)"},{"line_number":273,"context_line":""},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"def generate(conf):"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_b33fcad5","line":272,"in_reply_to":"ba7be1f8_ffb59ccd","updated":"2015-02-22 17:34:21.000000000","message":"Done","commit_id":"2e020ccfda9a4e5817410ad8443b77ab61bcce88"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"ee38326579d8d148cfb5a3bf7ff91a84bc578e30","unresolved":false,"context_lines":[{"line_number":266,"context_line":""},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"def on_load_failure_callback(manager, ep, exc):"},{"line_number":269,"context_line":"    raise cfg.OptsLoadFromNamespaceError(ep, exc)"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"def generate(conf):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_218d2032","line":269,"updated":"2015-02-23 22:12:45.000000000","message":"If you make this just \"raise\" and do not create an exception it should propagate the existing exception with a better traceback. The current implementation will make it look like all errors start here on this line, so we\u0027ll lose useful traceback information.","commit_id":"635f39893c549c3aacc685586ece59e8a66fec7d"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"f0369a3e1458de7b4901100391d67e0e3e3d1c7d","unresolved":false,"context_lines":[{"line_number":266,"context_line":""},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"def on_load_failure_callback(manager, ep, exc):"},{"line_number":269,"context_line":"    raise cfg.OptsLoadFromNamespaceError(ep, exc)"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"def generate(conf):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_810dec40","line":269,"in_reply_to":"ba7be1f8_218d2032","updated":"2015-02-23 22:15:42.000000000","message":"\"exc\" is \u0027text\u0027 here, nothing to raise.","commit_id":"635f39893c549c3aacc685586ece59e8a66fec7d"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"2af8471478315e664722d7cc907ec96fb6d69125","unresolved":false,"context_lines":[{"line_number":266,"context_line":""},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"def on_load_failure_callback(manager, ep, exc):"},{"line_number":269,"context_line":"    raise cfg.OptsLoadFromNamespaceError(ep, exc)"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":""},{"line_number":272,"context_line":"def generate(conf):"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_18731fb2","line":269,"in_reply_to":"ba7be1f8_810dec40","updated":"2015-02-24 07:12:46.000000000","message":"Done","commit_id":"635f39893c549c3aacc685586ece59e8a66fec7d"}],"oslo_config/tests/test_generator.py":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"327038facb24ea63ffcb48b157cd834cb6468a0c","unresolved":false,"context_lines":[{"line_number":539,"context_line":""},{"line_number":540,"context_line":"    @mock.patch(\u0027stevedore.named.NamedExtensionManager\u0027)"},{"line_number":541,"context_line":"    @mock.patch(\u0027oslo_config.generator.LOG\u0027)"},{"line_number":542,"context_line":"    def test_generate_get_error(self, mock_log, named_mgr):"},{"line_number":543,"context_line":"        class FakeException(Exception):"},{"line_number":544,"context_line":"            pass"},{"line_number":545,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_92ef7e86","line":542,"updated":"2015-02-19 20:14:40.000000000","message":"I don\u0027t think this belongs in GeneratorTestCase.  This is a class for use with testscenarios, which means this test would be run once for each scenario listed above.  Given that we\u0027re trying to verify one specific behavior that\u0027s unnecessary.\n\nIn fact, this is basically a duplicate of the test function above, which tells me we should be able to implement it as just another test scenario.  Simply add a new scenario with a new parameter called something like generate_exception and then add an if self.generate_exception block around the generator.generate call.  Look at the behavior of log_warning for an example of how this works (although this parameter could simply be a boolean rather than a string).\n\nThe generate code block would look something like this:\n\n if self.generate_exception:\n   named_mgr.side_effect \u003d FakeException\n   self.assertRaises(...)\n   return\n else:\n   generator.generate(self.conf)\n\nLet me know if you have any questions about how to do this.","commit_id":"2e020ccfda9a4e5817410ad8443b77ab61bcce88"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"f1c92b7f976c37ef04e5e0eb44ca4ee5032754f4","unresolved":false,"context_lines":[{"line_number":539,"context_line":""},{"line_number":540,"context_line":"    @mock.patch(\u0027stevedore.named.NamedExtensionManager\u0027)"},{"line_number":541,"context_line":"    @mock.patch(\u0027oslo_config.generator.LOG\u0027)"},{"line_number":542,"context_line":"    def test_generate_get_error(self, mock_log, named_mgr):"},{"line_number":543,"context_line":"        class FakeException(Exception):"},{"line_number":544,"context_line":"            pass"},{"line_number":545,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_d3251ec3","line":542,"in_reply_to":"ba7be1f8_3f3c942f","updated":"2015-02-22 17:34:21.000000000","message":"Done","commit_id":"2e020ccfda9a4e5817410ad8443b77ab61bcce88"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"e1adb3da2c407b79d7a6a29c18cb656b79a8bc7a","unresolved":false,"context_lines":[{"line_number":539,"context_line":""},{"line_number":540,"context_line":"    @mock.patch(\u0027stevedore.named.NamedExtensionManager\u0027)"},{"line_number":541,"context_line":"    @mock.patch(\u0027oslo_config.generator.LOG\u0027)"},{"line_number":542,"context_line":"    def test_generate_get_error(self, mock_log, named_mgr):"},{"line_number":543,"context_line":"        class FakeException(Exception):"},{"line_number":544,"context_line":"            pass"},{"line_number":545,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_ff207eb1","line":542,"in_reply_to":"da86d52c_92ef7e86","updated":"2015-02-19 23:09:48.000000000","message":"You are right, this is duplicate, that performs twice all scenarios, BUT, moreover, \"fix of this commit\" can not be covered by test with mocked \u0027stevedore.named.NamedExtensionManager\u0027 just because it is the reason. So, I will add new test that will expect real exception from it.","commit_id":"2e020ccfda9a4e5817410ad8443b77ab61bcce88"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"c966a61b7b3fc6916e1d9415a943d84132e0c789","unresolved":false,"context_lines":[{"line_number":539,"context_line":""},{"line_number":540,"context_line":"    @mock.patch(\u0027stevedore.named.NamedExtensionManager\u0027)"},{"line_number":541,"context_line":"    @mock.patch(\u0027oslo_config.generator.LOG\u0027)"},{"line_number":542,"context_line":"    def test_generate_get_error(self, mock_log, named_mgr):"},{"line_number":543,"context_line":"        class FakeException(Exception):"},{"line_number":544,"context_line":"            pass"},{"line_number":545,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba7be1f8_3f3c942f","line":542,"in_reply_to":"da86d52c_ff207eb1","updated":"2015-02-20 20:57:08.000000000","message":"I feel like we should be able to test this as just another scenario though, and if we can\u0027t then we may need to reconsider the change.  See my comment on the previous file for a suggestion that might make it work.","commit_id":"2e020ccfda9a4e5817410ad8443b77ab61bcce88"},{"author":{"_account_id":2472,"name":"Doug Hellmann","email":"dhellmann@redhat.com","username":"doug-hellmann"},"change_message_id":"ee38326579d8d148cfb5a3bf7ff91a84bc578e30","unresolved":false,"context_lines":[{"line_number":512,"context_line":"            self.config(output_file\u003doutput_file)"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        generate_exception \u003d getattr(self, \u0027generate_exception\u0027, None)"},{"line_number":515,"context_line":"        if generate_exception:"},{"line_number":516,"context_line":"            fake_eps \u003d mock.Mock(return_value\u003d[\u0027callback_is_expected\u0027])"},{"line_number":517,"context_line":"            with mock.patch(\u0027pkg_resources.iter_entry_points\u0027, fake_eps):"},{"line_number":518,"context_line":"                self.assertRaises("}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_21f36074","line":515,"updated":"2015-02-23 22:12:45.000000000","message":"We only need to test the exception handling one time, so we should only need the function to be run once. Instead of creating a scenario variable that is checked in each scenario, it would be better to just create a new test class in this file with one method.","commit_id":"635f39893c549c3aacc685586ece59e8a66fec7d"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"f0369a3e1458de7b4901100391d67e0e3e3d1c7d","unresolved":false,"context_lines":[{"line_number":512,"context_line":"            self.config(output_file\u003doutput_file)"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        generate_exception \u003d getattr(self, \u0027generate_exception\u0027, None)"},{"line_number":515,"context_line":"        if generate_exception:"},{"line_number":516,"context_line":"            fake_eps \u003d mock.Mock(return_value\u003d[\u0027callback_is_expected\u0027])"},{"line_number":517,"context_line":"            with mock.patch(\u0027pkg_resources.iter_entry_points\u0027, fake_eps):"},{"line_number":518,"context_line":"                self.assertRaises("}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_332573ab","line":515,"in_reply_to":"ba7be1f8_21f36074","updated":"2015-02-23 22:15:42.000000000","message":"It is requested by Ben Nemec. So, here is contradiction.","commit_id":"635f39893c549c3aacc685586ece59e8a66fec7d"},{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"8de32456cfbc249e58cb9fd1bcfada71a95a9ef9","unresolved":false,"context_lines":[{"line_number":512,"context_line":"            self.config(output_file\u003doutput_file)"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        generate_exception \u003d getattr(self, \u0027generate_exception\u0027, None)"},{"line_number":515,"context_line":"        if generate_exception:"},{"line_number":516,"context_line":"            fake_eps \u003d mock.Mock(return_value\u003d[\u0027callback_is_expected\u0027])"},{"line_number":517,"context_line":"            with mock.patch(\u0027pkg_resources.iter_entry_points\u0027, fake_eps):"},{"line_number":518,"context_line":"                self.assertRaises("}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_76f43987","line":515,"in_reply_to":"ba7be1f8_332573ab","updated":"2015-02-23 22:53:23.000000000","message":"My main thing was to avoid duplicating all the setup logic.  I thought there were other one-off scenarios, but now that I look again I think that\u0027s not true.  Given that it probably is better to do this as a more minimal standalone test.  Sorry for the misdirection.","commit_id":"635f39893c549c3aacc685586ece59e8a66fec7d"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"2af8471478315e664722d7cc907ec96fb6d69125","unresolved":false,"context_lines":[{"line_number":512,"context_line":"            self.config(output_file\u003doutput_file)"},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"        generate_exception \u003d getattr(self, \u0027generate_exception\u0027, None)"},{"line_number":515,"context_line":"        if generate_exception:"},{"line_number":516,"context_line":"            fake_eps \u003d mock.Mock(return_value\u003d[\u0027callback_is_expected\u0027])"},{"line_number":517,"context_line":"            with mock.patch(\u0027pkg_resources.iter_entry_points\u0027, fake_eps):"},{"line_number":518,"context_line":"                self.assertRaises("}],"source_content_type":"text/x-python","patch_set":5,"id":"ba7be1f8_d878a791","line":515,"in_reply_to":"ba7be1f8_76f43987","updated":"2015-02-24 07:12:46.000000000","message":"Done","commit_id":"635f39893c549c3aacc685586ece59e8a66fec7d"}],"tests/test_generator.py":[{"author":{"_account_id":6928,"name":"Ben Nemec","email":"openstack@nemebean.com","username":"bnemec"},"change_message_id":"327038facb24ea63ffcb48b157cd834cb6468a0c","unresolved":false,"context_lines":[{"line_number":554,"context_line":""},{"line_number":555,"context_line":"    @mock.patch(\u0027stevedore.named.NamedExtensionManager\u0027)"},{"line_number":556,"context_line":"    @mock.patch(\u0027oslo_config.generator.LOG\u0027)"},{"line_number":557,"context_line":"    def test_generate_get_error(self, mock_log, named_mgr):"},{"line_number":558,"context_line":"        class FakeException(Exception):"},{"line_number":559,"context_line":"            pass"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_52aa6671","line":557,"updated":"2015-02-19 20:14:40.000000000","message":"We actually don\u0027t need to do this here.  The files in the top-level tests directory are just for verifying backwards compatibility with the old namespace package code.  Since this is basically new functionality we don\u0027t need to test it against the old interface.","commit_id":"2e020ccfda9a4e5817410ad8443b77ab61bcce88"},{"author":{"_account_id":8851,"name":"Valeriy Ponomaryov","email":"kiparis.kh@gmail.com","username":"vponomaryov"},"change_message_id":"e1adb3da2c407b79d7a6a29c18cb656b79a8bc7a","unresolved":false,"context_lines":[{"line_number":554,"context_line":""},{"line_number":555,"context_line":"    @mock.patch(\u0027stevedore.named.NamedExtensionManager\u0027)"},{"line_number":556,"context_line":"    @mock.patch(\u0027oslo_config.generator.LOG\u0027)"},{"line_number":557,"context_line":"    def test_generate_get_error(self, mock_log, named_mgr):"},{"line_number":558,"context_line":"        class FakeException(Exception):"},{"line_number":559,"context_line":"            pass"},{"line_number":560,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"da86d52c_df773ad2","line":557,"in_reply_to":"da86d52c_52aa6671","updated":"2015-02-19 23:09:48.000000000","message":"Ok.","commit_id":"2e020ccfda9a4e5817410ad8443b77ab61bcce88"}]}
