)]}'
{"nova/network/security_group/openstack_driver.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"051437c4d542140a091e0b9d0b5b9d68e4a112f1","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def get_openstack_security_group_driver():"},{"line_number":28,"context_line":"    global DRIVER_CACHE"},{"line_number":29,"context_line":"    if DRIVER_CACHE is None:"},{"line_number":30,"context_line":"        if is_neutron_security_groups():"},{"line_number":31,"context_line":"            DRIVER_CACHE \u003d importutils.import_object(NEUTRON_DRIVER)"},{"line_number":32,"context_line":"        else:"},{"line_number":33,"context_line":"            DRIVER_CACHE \u003d importutils.import_object(NOVA_DRIVER)"},{"line_number":34,"context_line":"    return DRIVER_CACHE"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def is_neutron_security_groups():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_eff57885","line":34,"range":{"start_line":28,"start_character":2,"end_line":34,"end_character":23},"updated":"2019-12-03 16:04:58.000000000","message":"i assume you are doing it this way to backport it.\nthis should not be needed once stephens change to remove the nova networks support lands but i can see this being a good improvement on older releases.","commit_id":"0461921d9e5313c3e92b039b90f713ed961e20c8"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"8403e63e3b68fd51cb2904b45563bb0db122fab3","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def get_openstack_security_group_driver():"},{"line_number":28,"context_line":"    global DRIVER_CACHE"},{"line_number":29,"context_line":"    if DRIVER_CACHE is None:"},{"line_number":30,"context_line":"        if is_neutron_security_groups():"},{"line_number":31,"context_line":"            DRIVER_CACHE \u003d importutils.import_object(NEUTRON_DRIVER)"},{"line_number":32,"context_line":"        else:"},{"line_number":33,"context_line":"            DRIVER_CACHE \u003d importutils.import_object(NOVA_DRIVER)"},{"line_number":34,"context_line":"    return DRIVER_CACHE"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def is_neutron_security_groups():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_cba73bbc","line":34,"range":{"start_line":28,"start_character":2,"end_line":34,"end_character":23},"in_reply_to":"3fa7e38b_93b0aa42","updated":"2019-12-04 15:49:15.000000000","message":"So I\u0027m clear though, we don\u0027t need to worry about that once we merge [1] from the following patch in the series, right?\n\n[1] https://review.opendev.org/#/c/696512/4/nova/network/security_group/openstack_driver.py","commit_id":"0461921d9e5313c3e92b039b90f713ed961e20c8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6779a4324417fc3bf6ccf1777aae1a457fe73e8e","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def get_openstack_security_group_driver():"},{"line_number":28,"context_line":"    global DRIVER_CACHE"},{"line_number":29,"context_line":"    if DRIVER_CACHE is None:"},{"line_number":30,"context_line":"        if is_neutron_security_groups():"},{"line_number":31,"context_line":"            DRIVER_CACHE \u003d importutils.import_object(NEUTRON_DRIVER)"},{"line_number":32,"context_line":"        else:"},{"line_number":33,"context_line":"            DRIVER_CACHE \u003d importutils.import_object(NOVA_DRIVER)"},{"line_number":34,"context_line":"    return DRIVER_CACHE"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def is_neutron_security_groups():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_ab9aff5c","line":34,"range":{"start_line":28,"start_character":2,"end_line":34,"end_character":23},"in_reply_to":"3fa7e38b_cba73bbc","updated":"2019-12-04 15:52:16.000000000","message":"Your change is going to regress this essentially singleton pattern so I think something needs to be done in your change still because just looking at the nova.compute.api.API init it\u0027s going to create a new security group driver class and that API init happens for the majority of our route handlers and that\u0027s per worker so it\u0027s going to be a lot. See how we handled SchedulerReportClient in the API as a singleton - something similar should be done if we remove the cache code here.","commit_id":"0461921d9e5313c3e92b039b90f713ed961e20c8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ac6079f55a915b73fd9c5d260ec4db741a3ef97d","unresolved":false,"context_lines":[{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"def get_openstack_security_group_driver():"},{"line_number":28,"context_line":"    global DRIVER_CACHE"},{"line_number":29,"context_line":"    if DRIVER_CACHE is None:"},{"line_number":30,"context_line":"        if is_neutron_security_groups():"},{"line_number":31,"context_line":"            DRIVER_CACHE \u003d importutils.import_object(NEUTRON_DRIVER)"},{"line_number":32,"context_line":"        else:"},{"line_number":33,"context_line":"            DRIVER_CACHE \u003d importutils.import_object(NOVA_DRIVER)"},{"line_number":34,"context_line":"    return DRIVER_CACHE"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"def is_neutron_security_groups():"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_93b0aa42","line":34,"range":{"start_line":28,"start_character":2,"end_line":34,"end_character":23},"in_reply_to":"3fa7e38b_eff57885","updated":"2019-12-03 17:48:13.000000000","message":"Yes this should be backported and yes we\u0027d still want this even after Stephen\u0027s changes since it doesn\u0027t cache the imported driver or make it a singleton in any way:\n\nhttps://review.opendev.org/#/c/696511/4/nova/network/security_group/openstack_driver.py","commit_id":"0461921d9e5313c3e92b039b90f713ed961e20c8"}],"nova/tests/unit/network/test_config.py":[{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"051437c4d542140a091e0b9d0b5b9d68e4a112f1","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            driver,"},{"line_number":59,"context_line":"            nova.compute.api.SecurityGroupAPI)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @mock.patch(\u0027oslo_utils.importutils.import_object\u0027)"},{"line_number":62,"context_line":"    def test_caches(self, mock_import):"},{"line_number":63,"context_line":"        self.flags(use_neutron\u003dTrue)"},{"line_number":64,"context_line":"        sgapi.DRIVER_CACHE \u003d None"},{"line_number":65,"context_line":"        for _ in range(2):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_0f36d450","line":62,"range":{"start_line":61,"start_character":2,"end_line":62,"end_character":39},"updated":"2019-12-03 16:04:58.000000000","message":"im not really sure what you are doing here.\n\ni would have just mocked the global rather then the import method.\ncan you explain why you are doing it this way as i don\u0027t think its obvious","commit_id":"0461921d9e5313c3e92b039b90f713ed961e20c8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ac6079f55a915b73fd9c5d260ec4db741a3ef97d","unresolved":false,"context_lines":[{"line_number":58,"context_line":"            driver,"},{"line_number":59,"context_line":"            nova.compute.api.SecurityGroupAPI)"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @mock.patch(\u0027oslo_utils.importutils.import_object\u0027)"},{"line_number":62,"context_line":"    def test_caches(self, mock_import):"},{"line_number":63,"context_line":"        self.flags(use_neutron\u003dTrue)"},{"line_number":64,"context_line":"        sgapi.DRIVER_CACHE \u003d None"},{"line_number":65,"context_line":"        for _ in range(2):"}],"source_content_type":"text/x-python","patch_set":1,"id":"3fa7e38b_93898a70","line":62,"range":{"start_line":61,"start_character":2,"end_line":62,"end_character":39},"in_reply_to":"3fa7e38b_0f36d450","updated":"2019-12-03 17:48:13.000000000","message":"The test was originally hitting both the neutron and nova-net cases but then I decided that wasn\u0027t really necessary so just went with this but left the import mock to make sure it\u0027s called how we want rather than doing some kind of assertIsInstance on the value of the DRIVER_CACHE global. It doesn\u0027t matter to me too much either way if people want me to change it.","commit_id":"0461921d9e5313c3e92b039b90f713ed961e20c8"}]}
