)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"362cba654c3c2cf8a875064a24ce288d77cd573b","unresolved":false,"context_lines":[{"line_number":10,"context_line":"refresh the info_cache after it is deleted."},{"line_number":11,"context_line":"This patch makes it so the info_cache is refreshed when an associated"},{"line_number":12,"context_line":"floating IP is deleted. If there is no info_cache associated with the"},{"line_number":13,"context_line":"floating IP then info_cache is not refreshed."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"Change-Id: I8a8ae8cdbe2d9d77e7f1ae94ebdf6e4ad46eaf00"},{"line_number":16,"context_line":"Closes-Bug:  #1614538"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa7ab95a_25031178","line":13,"updated":"2016-08-31 13:35:57.000000000","message":"There should probably be a note in here about why we\u0027re not using the refresh_cache decorator, and that\u0027s because in some cases when the method is called we don\u0027t have an instance, which will raise an exception in the refresh_cache decorator, so we have to basically mimic what it does in the neutron API method based on whether or not we have an instance.","commit_id":"243f33af048dfebdbe3ecb65652c63e23cc12891"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"4a3d1f06b2727f45074cc8ce4ffb242d03b279dd","unresolved":false,"context_lines":[{"line_number":1893,"context_line":""},{"line_number":1894,"context_line":"        self._release_floating_ip(context, address)"},{"line_number":1895,"context_line":""},{"line_number":1896,"context_line":"    @base_api.refresh_cache"},{"line_number":1897,"context_line":"    def disassociate_and_release_floating_ip(self, context, instance,"},{"line_number":1898,"context_line":"                                           floating_ip):"},{"line_number":1899,"context_line":"        \"\"\"Removes (deallocates) and deletes the floating IP."}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_f613c10b","line":1896,"updated":"2016-08-19 13:35:48.000000000","message":"This fails in certain scenarios, like if the floating IP isn\u0027t associated to an instance:\n\nhttp://logs.openstack.org/95/356095/3/check/gate-tempest-dsvm-neutron-full-ubuntu-xenial/7760b9c/logs/screen-n-api.txt.gz?level\u003dTRACE#_2016-08-19_00_56_10_226\n\nThat\u0027s because the REST API doesn\u0027t get an instance here:\n\nhttps://github.com/openstack/nova/blob/master/nova/api/openstack/compute/floating_ips.py#L195\n\nBecause there isn\u0027t one associated with the floating IP in this test scenario:\n\nhttps://github.com/openstack/nova/blob/master/nova/api/openstack/compute/floating_ips.py#L195\n\nIt\u0027s just (1) create floating IP (2) get floating IP details (3) delete floating IP.\n\nThe refresh_cache decorator requires there to be an instance, so we can\u0027t rely on that here.","commit_id":"92b25a58296e6a71e4796d7d6839ed606cfc48f6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1a37b8765500f83a73d2ace3d46140fcb8c7df8","unresolved":false,"context_lines":[{"line_number":1893,"context_line":""},{"line_number":1894,"context_line":"        self._release_floating_ip(context, address)"},{"line_number":1895,"context_line":""},{"line_number":1896,"context_line":"    @base_api.refresh_cache"},{"line_number":1897,"context_line":"    def disassociate_and_release_floating_ip(self, context, instance,"},{"line_number":1898,"context_line":"                                           floating_ip):"},{"line_number":1899,"context_line":"        \"\"\"Removes (deallocates) and deletes the floating IP."}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_75e7c612","line":1896,"in_reply_to":"1ac06dbe_562575c0","updated":"2016-08-19 13:56:15.000000000","message":"Another option would be to create a @base_api.maybe_refresh_cache decorator which doesn\u0027t fail if there isn\u0027t an instance, but otherwise shares the same code as refresh_cache for the locking and nw info update stuff. That might be cleaner.","commit_id":"92b25a58296e6a71e4796d7d6839ed606cfc48f6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"eb02236cdc36d943573519532628de8078f2806c","unresolved":false,"context_lines":[{"line_number":1893,"context_line":""},{"line_number":1894,"context_line":"        self._release_floating_ip(context, address)"},{"line_number":1895,"context_line":""},{"line_number":1896,"context_line":"    @base_api.refresh_cache"},{"line_number":1897,"context_line":"    def disassociate_and_release_floating_ip(self, context, instance,"},{"line_number":1898,"context_line":"                                           floating_ip):"},{"line_number":1899,"context_line":"        \"\"\"Removes (deallocates) and deletes the floating IP."}],"source_content_type":"text/x-python","patch_set":1,"id":"1ac06dbe_562575c0","line":1896,"in_reply_to":"1ac06dbe_f613c10b","updated":"2016-08-19 13:41:30.000000000","message":"I wonder if we could basically copy what this decorator does, but make it conditional in this method on whether or not the instance was provided. But really just doing this:\n\nhttps://github.com/openstack/nova/blob/master/nova/network/base_api.py#L74-L79","commit_id":"92b25a58296e6a71e4796d7d6839ed606cfc48f6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"362cba654c3c2cf8a875064a24ce288d77cd573b","unresolved":false,"context_lines":[{"line_number":1902,"context_line":"        if using neutron."},{"line_number":1903,"context_line":"        \"\"\""},{"line_number":1904,"context_line":"        if instance is not None:"},{"line_number":1905,"context_line":"            with lockutils.lock(\u0027refresh_cache-%s\u0027 % instance.uuid):"},{"line_number":1906,"context_line":"                self._release_floating_ip(context, floating_ip[\u0027address\u0027],"},{"line_number":1907,"context_line":"                                          raise_if_associated\u003dFalse)"},{"line_number":1908,"context_line":"                base_api.update_instance_cache_with_nw_info(self, context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"fa7ab95a_c5f42589","line":1905,"updated":"2016-08-31 13:35:57.000000000","message":"You should probably make a note that this copies the behavior from the refresh_cache decorator, which we can\u0027t use because we don\u0027t always have an instance.\n\nNow that I think about that, we could re-use the refresh_cache decorator if we did it with an inner method, e.g.:\n\n  @refresh_cache\n  def _release_floating_ip_and_refresh_cache(self, context, instance, ...):\n    self._release_floating_ip(...)\n\n  if instance:\n    _release_floating_ip_and_refresh_cache(self, context,...)\n  else:\n    self._release_floating_ip(...)\n\nI\u0027m not sure if that\u0027s better or not, but at least we wouldn\u0027t have the duplication with the refresh_cache code.","commit_id":"243f33af048dfebdbe3ecb65652c63e23cc12891"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b166fb95606d5ef6823f64a6ad2e115cb8f0bce1","unresolved":false,"context_lines":[{"line_number":1908,"context_line":"        This api call was added to allow this to be done in one operation"},{"line_number":1909,"context_line":"        if using neutron."},{"line_number":1910,"context_line":"        \"\"\""},{"line_number":1911,"context_line":"        @base_api.refresh_cache"},{"line_number":1912,"context_line":"        def _release_floating_ip_and_refresh_cache(self, context, instance,"},{"line_number":1913,"context_line":"                                                   floating_ip):"},{"line_number":1914,"context_line":"            self._release_floating_ip(context, floating_ip[\u0027address\u0027],"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a89bdaa_9f5ff374","line":1911,"updated":"2016-09-02 19:23:33.000000000","message":"I\u0027m guessing pep8 is going to fail because there isn\u0027t a newline before this method def.","commit_id":"157ce1cb3f6923960ff125f981f2d49eae4fe8c5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"eca1fb8b20124d975ea095c2e43bbdd76b2a1f05","unresolved":false,"context_lines":[{"line_number":1919,"context_line":"        else:"},{"line_number":1920,"context_line":"            self._release_floating_ip(context, floating_ip[\u0027address\u0027],"},{"line_number":1921,"context_line":"                                     raise_if_associated\u003dFalse)"},{"line_number":1922,"context_line":"        # if instance is not None:"},{"line_number":1923,"context_line":"        #     with lockutils.lock(\u0027refresh_cache-%s\u0027 % instance.uuid):"},{"line_number":1924,"context_line":"        #         self._release_floating_ip(context, floating_ip[\u0027address\u0027],"},{"line_number":1925,"context_line":"        #                                   raise_if_associated\u003dFalse)"},{"line_number":1926,"context_line":"        #         base_api.update_instance_cache_with_nw_info(self, context,"},{"line_number":1927,"context_line":"        #                                                     instance,"},{"line_number":1928,"context_line":"        #                                                     nw_info\u003dNone)"},{"line_number":1929,"context_line":"        # else:"},{"line_number":1930,"context_line":"        #     self._release_floating_ip(context, floating_ip[\u0027address\u0027],"},{"line_number":1931,"context_line":"        #                               raise_if_associated\u003dFalse)"},{"line_number":1932,"context_line":""},{"line_number":1933,"context_line":"    def _release_floating_ip(self, context, address,"},{"line_number":1934,"context_line":"                             raise_if_associated\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a89bdaa_df825bc8","line":1931,"range":{"start_line":1922,"start_character":8,"end_line":1931,"end_character":66},"updated":"2016-09-02 19:22:50.000000000","message":"I\u0027m guessing this is leftover from local testing or something, but it should be removed.","commit_id":"157ce1cb3f6923960ff125f981f2d49eae4fe8c5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"74e939fe424923a3c20b86131e1323f57c0971ba","unresolved":false,"context_lines":[{"line_number":1918,"context_line":"                                                   floating_ip)"},{"line_number":1919,"context_line":"        else:"},{"line_number":1920,"context_line":"            self._release_floating_ip(context, floating_ip[\u0027address\u0027],"},{"line_number":1921,"context_line":"                                     raise_if_associated\u003dFalse)"},{"line_number":1922,"context_line":""},{"line_number":1923,"context_line":"    def _release_floating_ip(self, context, address,"},{"line_number":1924,"context_line":"                             raise_if_associated\u003dTrue):"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_7302ed70","line":1921,"updated":"2016-09-06 21:07:15.000000000","message":"nit: it seems the alignment here got messed up a bit with the indent. Should probably fix that.","commit_id":"f0ef21d53cd0811611c6867bbe46f05fc35a9943"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"74e939fe424923a3c20b86131e1323f57c0971ba","unresolved":false,"context_lines":[{"line_number":2392,"context_line":"        address \u003d self.fip_unassociated[\u0027floating_ip_address\u0027]"},{"line_number":2393,"context_line":"        fip_id \u003d self.fip_unassociated[\u0027id\u0027]"},{"line_number":2394,"context_line":"        floating_ip \u003d {\u0027address\u0027: address}"},{"line_number":2395,"context_line":"        instance \u003d self._fake_instance_object(self.instance)"},{"line_number":2396,"context_line":""},{"line_number":2397,"context_line":"        self.moxed_client.list_floatingips(floating_ip_address\u003daddress).\\"},{"line_number":2398,"context_line":"            AndReturn({\u0027floatingips\u0027: [self.fip_unassociated]})"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a89bdaa_b33b9537","line":2395,"updated":"2016-09-06 21:07:15.000000000","message":"How about rather than modifying this test to go down refresh_cache route, we don\u0027t touch this test, but duplicate it and add this part where the instance is not none and the refresh_cache happens. That way we know both paths are hit.","commit_id":"f0ef21d53cd0811611c6867bbe46f05fc35a9943"},{"author":{"_account_id":6167,"name":"Ken\u0027ichi Ohmichi","email":"ken1ohmichi@gmail.com","username":"oomichi"},"change_message_id":"864e66e586b23417c599329ba33702f4eccecc07","unresolved":false,"context_lines":[{"line_number":2400,"context_line":"        api.disassociate_and_release_floating_ip(self.context, None,"},{"line_number":2401,"context_line":"                                               floating_ip)"},{"line_number":2402,"context_line":""},{"line_number":2403,"context_line":"    def test_disassociate_and_release_floating_ip_with_instance(self):"},{"line_number":2404,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2405,"context_line":"        address \u003d self.fip_unassociated[\u0027floating_ip_address\u0027]"},{"line_number":2406,"context_line":"        fip_id \u003d self.fip_unassociated[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a89bdaa_e7a19a95","line":2403,"updated":"2016-09-07 20:44:53.000000000","message":"This method is almost same as the previous test case test_disassociate_and_release_floating_ip, and we can reduce the code with some internal method and we will be able to see what difference between both.\nbut that can be kind of cleanup, and I am fine for current one.","commit_id":"cdb9b6820dc17971bca24adfc0b56f030f0ae827"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"49f701a6948f3f98e1139c7a64d231fd89d71ced","unresolved":false,"context_lines":[{"line_number":2400,"context_line":"        api.disassociate_and_release_floating_ip(self.context, None,"},{"line_number":2401,"context_line":"                                               floating_ip)"},{"line_number":2402,"context_line":""},{"line_number":2403,"context_line":"    def test_disassociate_and_release_floating_ip_with_instance(self):"},{"line_number":2404,"context_line":"        api \u003d neutronapi.API()"},{"line_number":2405,"context_line":"        address \u003d self.fip_unassociated[\u0027floating_ip_address\u0027]"},{"line_number":2406,"context_line":"        fip_id \u003d self.fip_unassociated[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"9a89bdaa_277c62b4","line":2403,"in_reply_to":"9a89bdaa_e7a19a95","updated":"2016-09-07 20:51:40.000000000","message":"True, this is easier for backporting though, which we need to do for this anyway.","commit_id":"cdb9b6820dc17971bca24adfc0b56f030f0ae827"}]}
