)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0f1f921e1f8fb1985d0e6f9576bbed24fcebd8d5","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix empty instance nw_info cache"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Race: instance nw_info cache is updated to empty list because of"},{"line_number":10,"context_line":"nova/neutron event mechanism when boot instance with port id."},{"line_number":11,"context_line":"Add lock in code branch of handling network change event, and"},{"line_number":12,"context_line":"refresh instance in order to get current nw_info cache."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a961159_76a58701","line":10,"updated":"2015-01-09 12:30:15.000000000","message":"booting*","commit_id":"145f3cec242d2e15d05798c8007624585077a6a7"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"553e641c5a4dd3a48cf6a56d8089713d1b19acec","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix empty instance nw_info cache"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Race: instance nw_info cache is updated to empty list because of"},{"line_number":10,"context_line":"nova/neutron event mechanism when boot instance with port id."},{"line_number":11,"context_line":"Add lock in code branch of handling network change event, and"},{"line_number":12,"context_line":"refresh instance in order to get current nw_info cache."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"3a961159_7447237b","line":10,"in_reply_to":"3a961159_76a58701","updated":"2015-01-12 02:11:50.000000000","message":"Done","commit_id":"145f3cec242d2e15d05798c8007624585077a6a7"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"4ea602e15b967554c2a9eae69d3a20720f7a5d78","unresolved":false,"context_lines":[{"line_number":13,"context_line":"the instance nw_info cache and fulfill system metadata for neutron"},{"line_number":14,"context_line":"and nova-network. Work together with \u0027refresh_cache\u0027 synchronous"},{"line_number":15,"context_line":"lock so that avoiding to update nw_info cache to empty list from"},{"line_number":16,"context_line":"network change event during booting instance."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I8f8d2db5a0a1180e4aada34c3aade855d9314611"},{"line_number":19,"context_line":"Closes-Bug: #1407664"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":26,"id":"ba7be1f8_b44d70c6","line":16,"updated":"2015-02-25 16:46:44.000000000","message":"I think that last sentence should be:\n\n    Take the \u0027refresh_cache\u0027 lock while booting an instance to avoid a Neutron event clearing the nw_info cache.\n\nI had real trouble understanding it though so please verify I haven\u0027t changed your meaning!","commit_id":"8550d1d05eefdf06e105bf1f9de7afce7afe1298"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"902d624413f6e6bf49c97d0ffd89b522750a70e2","unresolved":false,"context_lines":[{"line_number":13,"context_line":"the instance nw_info cache and fulfill system metadata for neutron"},{"line_number":14,"context_line":"and nova-network. Work together with \u0027refresh_cache\u0027 synchronous"},{"line_number":15,"context_line":"lock so that avoiding to update nw_info cache to empty list from"},{"line_number":16,"context_line":"network change event during booting instance."},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"Change-Id: I8f8d2db5a0a1180e4aada34c3aade855d9314611"},{"line_number":19,"context_line":"Closes-Bug: #1407664"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":26,"id":"ba7be1f8_def4a85c","line":16,"in_reply_to":"ba7be1f8_b44d70c6","updated":"2015-02-26 06:47:17.000000000","message":"Done","commit_id":"8550d1d05eefdf06e105bf1f9de7afce7afe1298"}],"nova/compute/manager.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cf0e095a70f858378ab35c4ba8c36bfe6bf05de2","unresolved":false,"context_lines":[{"line_number":6440,"context_line":"                      {\u0027event\u0027: event.key},"},{"line_number":6441,"context_line":"                      instance\u003dinstance)"},{"line_number":6442,"context_line":"            if event.name \u003d\u003d \u0027network-changed\u0027:"},{"line_number":6443,"context_line":"                self._get_instance_nw_info(context, instance)"},{"line_number":6444,"context_line":"            else:"},{"line_number":6445,"context_line":"                self._process_instance_event(instance, event)"},{"line_number":6446,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"7aaa499b_dfbc8d6e","line":6443,"updated":"2015-04-13 17:31:27.000000000","message":"Why are you making this change?","commit_id":"106d3868003e68ce26e23426313b98af5855b5f9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"eec41da8a8e917f99b26a4ec175609fa3b004da8","unresolved":false,"context_lines":[{"line_number":6440,"context_line":"                      {\u0027event\u0027: event.key},"},{"line_number":6441,"context_line":"                      instance\u003dinstance)"},{"line_number":6442,"context_line":"            if event.name \u003d\u003d \u0027network-changed\u0027:"},{"line_number":6443,"context_line":"                self._get_instance_nw_info(context, instance)"},{"line_number":6444,"context_line":"            else:"},{"line_number":6445,"context_line":"                self._process_instance_event(instance, event)"},{"line_number":6446,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"7aaa499b_ce9cba5f","line":6443,"in_reply_to":"7aaa499b_308cb034","updated":"2015-04-14 14:06:13.000000000","message":"If it\u0027s not related to this change, it should be in a separate patch. Since this is fixing an obscure bug, having this line be part of the change will make history harder to understand.","commit_id":"106d3868003e68ce26e23426313b98af5855b5f9"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"898b7cea49c75abd27d3f0a81b0d194d3b4076a7","unresolved":false,"context_lines":[{"line_number":6440,"context_line":"                      {\u0027event\u0027: event.key},"},{"line_number":6441,"context_line":"                      instance\u003dinstance)"},{"line_number":6442,"context_line":"            if event.name \u003d\u003d \u0027network-changed\u0027:"},{"line_number":6443,"context_line":"                self._get_instance_nw_info(context, instance)"},{"line_number":6444,"context_line":"            else:"},{"line_number":6445,"context_line":"                self._process_instance_event(instance, event)"},{"line_number":6446,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"7aaa499b_308cb034","line":6443,"in_reply_to":"7aaa499b_dfbc8d6e","updated":"2015-04-14 06:18:58.000000000","message":"All methods of ComputeManager use self._get_instance_nw_info except \u0027external_instance_event\u0027, I think we don\u0027t need two ways to do same thing.","commit_id":"106d3868003e68ce26e23426313b98af5855b5f9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0861b7318cd3aa3d909d8b184cd4a31d3e24a93a","unresolved":false,"context_lines":[{"line_number":6440,"context_line":"                      {\u0027event\u0027: event.key},"},{"line_number":6441,"context_line":"                      instance\u003dinstance)"},{"line_number":6442,"context_line":"            if event.name \u003d\u003d \u0027network-changed\u0027:"},{"line_number":6443,"context_line":"                self._get_instance_nw_info(context, instance)"},{"line_number":6444,"context_line":"            else:"},{"line_number":6445,"context_line":"                self._process_instance_event(instance, event)"},{"line_number":6446,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"7aaa499b_4e454ab1","line":6443,"updated":"2015-04-14 14:06:59.000000000","message":"I think you should remove this change from the patch and put it into a follow-up cleanup patch if you want it. See my comments on the previous set for why.","commit_id":"c669960589e07209237881e7236ad7499d5f5b22"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"6969d56a2bc58cf5f10c7c21061c21ce00ea990b","unresolved":false,"context_lines":[{"line_number":6440,"context_line":"                      {\u0027event\u0027: event.key},"},{"line_number":6441,"context_line":"                      instance\u003dinstance)"},{"line_number":6442,"context_line":"            if event.name \u003d\u003d \u0027network-changed\u0027:"},{"line_number":6443,"context_line":"                self._get_instance_nw_info(context, instance)"},{"line_number":6444,"context_line":"            else:"},{"line_number":6445,"context_line":"                self._process_instance_event(instance, event)"},{"line_number":6446,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"7aaa499b_4b2403ae","line":6443,"in_reply_to":"7aaa499b_4e454ab1","updated":"2015-04-15 03:15:11.000000000","message":"Done","commit_id":"c669960589e07209237881e7236ad7499d5f5b22"}],"nova/network/api.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cf0e095a70f858378ab35c4ba8c36bfe6bf05de2","unresolved":false,"context_lines":[{"line_number":370,"context_line":"    def get_instance_nw_info(self, context, instance, **kwargs):"},{"line_number":371,"context_line":"        \"\"\"Returns all network info related to an instance.\"\"\""},{"line_number":372,"context_line":"        return super(API, self).get_instance_nw_info(context, instance,"},{"line_number":373,"context_line":"                                                     **kwargs)"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def _get_instance_nw_info(self, context, instance, **kwargs):"},{"line_number":376,"context_line":"        \"\"\"Returns all network info related to an instance.\"\"\""}],"source_content_type":"text/x-python","patch_set":37,"id":"7aaa499b_9fb60589","line":373,"updated":"2015-04-13 17:31:27.000000000","message":"Why not just remove this from the subclass entirely?","commit_id":"106d3868003e68ce26e23426313b98af5855b5f9"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"898b7cea49c75abd27d3f0a81b0d194d3b4076a7","unresolved":false,"context_lines":[{"line_number":370,"context_line":"    def get_instance_nw_info(self, context, instance, **kwargs):"},{"line_number":371,"context_line":"        \"\"\"Returns all network info related to an instance.\"\"\""},{"line_number":372,"context_line":"        return super(API, self).get_instance_nw_info(context, instance,"},{"line_number":373,"context_line":"                                                     **kwargs)"},{"line_number":374,"context_line":""},{"line_number":375,"context_line":"    def _get_instance_nw_info(self, context, instance, **kwargs):"},{"line_number":376,"context_line":"        \"\"\"Returns all network info related to an instance.\"\"\""}],"source_content_type":"text/x-python","patch_set":37,"id":"7aaa499b_50b73cd8","line":373,"in_reply_to":"7aaa499b_9fb60589","updated":"2015-04-14 06:18:58.000000000","message":"nova-network need to check policy with decorator at here.","commit_id":"106d3868003e68ce26e23426313b98af5855b5f9"}],"nova/network/base_api.py":[{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0014a3fd5beb1e85fdad8ad21963dbae14fc2e4a","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def get_instance_nw_info(self, context, instance, **kwargs):"},{"line_number":238,"context_line":"        \"\"\"Returns all network info related to an instance.\"\"\""},{"line_number":239,"context_line":"        with lockutils.lock(\u0027refresh_cache-%s\u0027 % instance[\u0027uuid\u0027]):"},{"line_number":240,"context_line":"            # NOTE(danms): Several places in the code look up instances without"},{"line_number":241,"context_line":"            # pulling system_metadata for performance, and call this function."},{"line_number":242,"context_line":"            # If we get an instance without it, re-fetch so that the call"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a930d6b_8e24f760","line":239,"updated":"2015-01-26 11:36:14.000000000","message":"instance.uuid? There are also commits that replace the dict-like usage of instance in favor of object-like.","commit_id":"dbab315ee98e35cadd40e50009f77197b89e58ee"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"9617c620f7c8310b5c8f5409019eb37b249f2b26","unresolved":false,"context_lines":[{"line_number":236,"context_line":""},{"line_number":237,"context_line":"    def get_instance_nw_info(self, context, instance, **kwargs):"},{"line_number":238,"context_line":"        \"\"\"Returns all network info related to an instance.\"\"\""},{"line_number":239,"context_line":"        with lockutils.lock(\u0027refresh_cache-%s\u0027 % instance[\u0027uuid\u0027]):"},{"line_number":240,"context_line":"            # NOTE(danms): Several places in the code look up instances without"},{"line_number":241,"context_line":"            # pulling system_metadata for performance, and call this function."},{"line_number":242,"context_line":"            # If we get an instance without it, re-fetch so that the call"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa81d914_7b30fd56","line":239,"in_reply_to":"1a930d6b_8e24f760","updated":"2015-01-28 02:42:50.000000000","message":"Done","commit_id":"dbab315ee98e35cadd40e50009f77197b89e58ee"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0014a3fd5beb1e85fdad8ad21963dbae14fc2e4a","unresolved":false,"context_lines":[{"line_number":249,"context_line":"            # nova/neutron event reporting mechanism. See details:"},{"line_number":250,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1407664"},{"line_number":251,"context_line":"            instance \u003d objects.Instance.get_by_uuid(context,"},{"line_number":252,"context_line":"                                                    instance[\u0027uuid\u0027],"},{"line_number":253,"context_line":"                                                    expected_attrs\u003dattrs,"},{"line_number":254,"context_line":"                                                    use_slave\u003duse_slave)"},{"line_number":255,"context_line":"            result \u003d self._get_instance_nw_info(context, instance, **kwargs)"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a930d6b_ae29b338","line":252,"updated":"2015-01-26 11:36:14.000000000","message":"ditto.","commit_id":"dbab315ee98e35cadd40e50009f77197b89e58ee"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"9617c620f7c8310b5c8f5409019eb37b249f2b26","unresolved":false,"context_lines":[{"line_number":249,"context_line":"            # nova/neutron event reporting mechanism. See details:"},{"line_number":250,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1407664"},{"line_number":251,"context_line":"            instance \u003d objects.Instance.get_by_uuid(context,"},{"line_number":252,"context_line":"                                                    instance[\u0027uuid\u0027],"},{"line_number":253,"context_line":"                                                    expected_attrs\u003dattrs,"},{"line_number":254,"context_line":"                                                    use_slave\u003duse_slave)"},{"line_number":255,"context_line":"            result \u003d self._get_instance_nw_info(context, instance, **kwargs)"}],"source_content_type":"text/x-python","patch_set":13,"id":"fa81d914_5b2b39eb","line":252,"in_reply_to":"1a930d6b_ae29b338","updated":"2015-01-28 02:42:50.000000000","message":"Done","commit_id":"dbab315ee98e35cadd40e50009f77197b89e58ee"},{"author":{"_account_id":8688,"name":"Alexis Lee","email":"openstack@lxsli.co.uk","username":"lxsli"},"change_message_id":"4ea602e15b967554c2a9eae69d3a20720f7a5d78","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            # pulling system_metadata for performance, and call this function."},{"line_number":243,"context_line":"            # If we get an instance without it, re-fetch so that the call"},{"line_number":244,"context_line":"            # to network_api (which requires it for instance_type) will"},{"line_number":245,"context_line":"            # succeed."},{"line_number":246,"context_line":"            attrs \u003d [\u0027system_metadata\u0027]"},{"line_number":247,"context_line":"            use_slave \u003d kwargs.get(\u0027use_slave\u0027, False)"},{"line_number":248,"context_line":"            # NOTE(Rui Chen): Refresh instance in order to avoid race"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_4f5ae12a","line":245,"updated":"2015-02-25 16:46:44.000000000","message":"This comment doesn\u0027t make sense here. Suggest:\n\n    NOTE(Rui Chen): The instance may have been retrieved\n    without system_metadata attached, for performance. If it\u0027s\n    missing, fetch it.","commit_id":"8550d1d05eefdf06e105bf1f9de7afce7afe1298"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"902d624413f6e6bf49c97d0ffd89b522750a70e2","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            # pulling system_metadata for performance, and call this function."},{"line_number":243,"context_line":"            # If we get an instance without it, re-fetch so that the call"},{"line_number":244,"context_line":"            # to network_api (which requires it for instance_type) will"},{"line_number":245,"context_line":"            # succeed."},{"line_number":246,"context_line":"            attrs \u003d [\u0027system_metadata\u0027]"},{"line_number":247,"context_line":"            use_slave \u003d kwargs.get(\u0027use_slave\u0027, False)"},{"line_number":248,"context_line":"            # NOTE(Rui Chen): Refresh instance in order to avoid race"}],"source_content_type":"text/x-python","patch_set":26,"id":"ba7be1f8_5e2358bc","line":245,"in_reply_to":"ba7be1f8_4f5ae12a","updated":"2015-02-26 06:47:17.000000000","message":"Done","commit_id":"8550d1d05eefdf06e105bf1f9de7afce7afe1298"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d404ea665f423ffb2978f30b43ce15ec7019526c","unresolved":false,"context_lines":[{"line_number":249,"context_line":"            instance \u003d objects.Instance.get_by_uuid(context,"},{"line_number":250,"context_line":"                                                    instance.uuid,"},{"line_number":251,"context_line":"                                                    expected_attrs\u003dattrs,"},{"line_number":252,"context_line":"                                                    use_slave\u003duse_slave)"},{"line_number":253,"context_line":"            result \u003d self._get_instance_nw_info(context, instance, **kwargs)"},{"line_number":254,"context_line":"            # NOTE(comstud): Don\u0027t update API cell with new info_cache every"},{"line_number":255,"context_line":"            # time we pull network info for an instance.  The periodic healing"}],"source_content_type":"text/x-python","patch_set":28,"id":"ba7be1f8_41d918f2","line":252,"updated":"2015-03-02 20:52:17.000000000","message":"We don\u0027t need to load system_metadata explicitly here anymore (see the patch that conflicts with this one already in the tree).\n\nAlso, this is extremely heavy to just refresh info_cache. If that\u0027s what you want to do, then _just_ refresh it explicitly.","commit_id":"77c899f14effa99c5f1c2b8ddbb4ea8c97e322ad"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"19d31f0d4e18388f6333d509b609094dbea4e58b","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            update_instance_cache_with_nw_info(self, context, instance,"},{"line_number":252,"context_line":"                                               nw_info\u003dresult,"},{"line_number":253,"context_line":"                                               update_cells\u003dFalse)"},{"line_number":254,"context_line":"        return result"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def _get_instance_nw_info(self, context, instance, **kwargs):"},{"line_number":257,"context_line":"        \"\"\"Template method, so a subclass can implement for neutron/network.\"\"\""}],"source_content_type":"text/x-python","patch_set":38,"id":"7aaa499b_8bac6436","line":254,"updated":"2015-04-14 13:52:02.000000000","message":"even if this is covered by the unittest you modified, I think it would be worth to add an explicit unittest for that method as a behavioural change could hide a further change and the unittest could maybe still be happy.","commit_id":"c669960589e07209237881e7236ad7499d5f5b22"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"6969d56a2bc58cf5f10c7c21061c21ce00ea990b","unresolved":false,"context_lines":[{"line_number":251,"context_line":"            update_instance_cache_with_nw_info(self, context, instance,"},{"line_number":252,"context_line":"                                               nw_info\u003dresult,"},{"line_number":253,"context_line":"                                               update_cells\u003dFalse)"},{"line_number":254,"context_line":"        return result"},{"line_number":255,"context_line":""},{"line_number":256,"context_line":"    def _get_instance_nw_info(self, context, instance, **kwargs):"},{"line_number":257,"context_line":"        \"\"\"Template method, so a subclass can implement for neutron/network.\"\"\""}],"source_content_type":"text/x-python","patch_set":38,"id":"7aaa499b_eb4cef71","line":254,"in_reply_to":"7aaa499b_8bac6436","updated":"2015-04-15 03:15:11.000000000","message":"Done","commit_id":"c669960589e07209237881e7236ad7499d5f5b22"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"a13e88bfa591ef60a0d827622227c1ef593a80c4","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            # race condition between booting/attaching_interface and"},{"line_number":243,"context_line":"            # nova/neutron event reporting mechanism. See details:"},{"line_number":244,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1407664"},{"line_number":245,"context_line":"            instance.info_cache.refresh()"},{"line_number":246,"context_line":"            result \u003d self._get_instance_nw_info(context, instance, **kwargs)"},{"line_number":247,"context_line":"            # NOTE(comstud): Don\u0027t update API cell with new info_cache every"},{"line_number":248,"context_line":"            # time we pull network info for an instance.  The periodic healing"}],"source_content_type":"text/x-python","patch_set":46,"id":"7a016987_dea55e47","line":245,"updated":"2015-05-28 09:31:04.000000000","message":"I don\u0027t get how this fixes anything - it just adds a DB call to read something we will immediately overwrite.","commit_id":"9ffeea2ec7c4066f4b832d0e8936843a0678b88f"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"1bf6e9caaba5c7e523b2adf62757ed9fb5516c4b","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            # race condition between booting/attaching_interface and"},{"line_number":243,"context_line":"            # nova/neutron event reporting mechanism. See details:"},{"line_number":244,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1407664"},{"line_number":245,"context_line":"            instance.info_cache.refresh()"},{"line_number":246,"context_line":"            result \u003d self._get_instance_nw_info(context, instance, **kwargs)"},{"line_number":247,"context_line":"            # NOTE(comstud): Don\u0027t update API cell with new info_cache every"},{"line_number":248,"context_line":"            # time we pull network info for an instance.  The periodic healing"}],"source_content_type":"text/x-python","patch_set":46,"id":"7a016987_e393def8","line":245,"in_reply_to":"7a016987_0085d0ab","updated":"2015-05-28 10:20:06.000000000","message":"So in that case - I\u0027d re-post your patch so we can approve that as a bugfix ASAP, and then we can do this refactor later.","commit_id":"9ffeea2ec7c4066f4b832d0e8936843a0678b88f"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"2b428fd7f3dd4cc176cbbf28f0ac1c951eb741c6","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            # race condition between booting/attaching_interface and"},{"line_number":243,"context_line":"            # nova/neutron event reporting mechanism. See details:"},{"line_number":244,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1407664"},{"line_number":245,"context_line":"            instance.info_cache.refresh()"},{"line_number":246,"context_line":"            result \u003d self._get_instance_nw_info(context, instance, **kwargs)"},{"line_number":247,"context_line":"            # NOTE(comstud): Don\u0027t update API cell with new info_cache every"},{"line_number":248,"context_line":"            # time we pull network info for an instance.  The periodic healing"}],"source_content_type":"text/x-python","patch_set":46,"id":"7a016987_0085d0ab","line":245,"in_reply_to":"7a016987_dea55e47","updated":"2015-05-28 09:57:21.000000000","message":"I\u0027m kind of agree with you, but the fix is well here. The case happen only at the boot time:\nso at the boot network_info of the instance is an empty list and by the event mechanism of nova/neutron, neutron will populate the database. So here we fetch those information because if we don\u0027t do that, when calling the method get_instance_nw_info which will call _build_network_info_model the method will still return an empty list.\n\nNow we have this fix https://review.openstack.org/#/c/186315/ which is i guess the real fix so we can probably remove this line and consider this change as a good refactor. Yes.","commit_id":"9ffeea2ec7c4066f4b832d0e8936843a0678b88f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"1328f5dfcc037c7b0dffc4e0c2fd7d6cfab9c27a","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            # race condition between booting/attaching_interface and"},{"line_number":243,"context_line":"            # nova/neutron event reporting mechanism. See details:"},{"line_number":244,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1407664"},{"line_number":245,"context_line":"            instance.info_cache.refresh()"},{"line_number":246,"context_line":"            result \u003d self._get_instance_nw_info(context, instance, **kwargs)"},{"line_number":247,"context_line":"            # NOTE(comstud): Don\u0027t update API cell with new info_cache every"},{"line_number":248,"context_line":"            # time we pull network info for an instance.  The periodic healing"}],"source_content_type":"text/x-python","patch_set":46,"id":"7a016987_faab7f1c","line":245,"in_reply_to":"7a016987_e393def8","updated":"2015-05-28 12:46:30.000000000","message":"ok, if we decide to merge sahid\u0027s patch, it also can fix this bug, I will update the patch as a refactor.","commit_id":"9ffeea2ec7c4066f4b832d0e8936843a0678b88f"},{"author":{"_account_id":5511,"name":"Nikola Dipanov","email":"ndipanov@redhat.com","username":"ndipanov"},"change_message_id":"1b7a813c9e5b46445f91083b57accccd067b8998","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            # race condition between booting/attaching_interface and"},{"line_number":243,"context_line":"            # nova/neutron event reporting mechanism. See details:"},{"line_number":244,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1407664"},{"line_number":245,"context_line":"            instance.info_cache.refresh()"},{"line_number":246,"context_line":"            result \u003d self._get_instance_nw_info(context, instance, **kwargs)"},{"line_number":247,"context_line":"            # NOTE(comstud): Don\u0027t update API cell with new info_cache every"},{"line_number":248,"context_line":"            # time we pull network info for an instance.  The periodic healing"}],"source_content_type":"text/x-python","patch_set":46,"id":"7a016987_d5de2d10","line":245,"in_reply_to":"7a016987_faab7f1c","updated":"2015-05-29 09:27:03.000000000","message":"Yeah - I think that\u0027s the best thing - since this refactor is useful for sure. I would just drop this line here.","commit_id":"9ffeea2ec7c4066f4b832d0e8936843a0678b88f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"020477dfd6dda797521472efd775b1cd02432883","unresolved":false,"context_lines":[{"line_number":238,"context_line":"    def get_instance_nw_info(self, context, instance, **kwargs):"},{"line_number":239,"context_line":"        \"\"\"Returns all network info related to an instance.\"\"\""},{"line_number":240,"context_line":"        with lockutils.lock(\u0027refresh_cache-%s\u0027 % instance.uuid):"},{"line_number":241,"context_line":"            result \u003d self._get_instance_nw_info(context, instance, **kwargs)"},{"line_number":242,"context_line":"            # NOTE(comstud): Don\u0027t update API cell with new info_cache every"},{"line_number":243,"context_line":"            # time we pull network info for an instance.  The periodic healing"},{"line_number":244,"context_line":"            # of info_cache causes too many cells messages.  Healing the API"}],"source_content_type":"text/x-python","patch_set":47,"id":"3afb71cf_d3269bcd","line":241,"updated":"2015-06-08 03:46:47.000000000","message":"here","commit_id":"e79045ee63da495752da8c2e2f7d94dabda6319d"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"d9fefa2a6e7fcd3378b7b79160cf14a2695dc4bf","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                                               update_cells\u003dFalse)"},{"line_number":249,"context_line":"        return result"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def _get_instance_nw_info(self, context, instance, **kwargs):"},{"line_number":252,"context_line":"        \"\"\"Template method, so a subclass can implement for neutron/network.\"\"\""},{"line_number":253,"context_line":"        raise NotImplementedError()"},{"line_number":254,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"3afb71cf_6eee0724","line":251,"updated":"2015-06-05 14:44:09.000000000","message":"Why is the **kwargs necessary? It\u0027s not used in any of the implementations of this method, in neither neutronv2/api or networking/api.","commit_id":"e79045ee63da495752da8c2e2f7d94dabda6319d"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"020477dfd6dda797521472efd775b1cd02432883","unresolved":false,"context_lines":[{"line_number":248,"context_line":"                                               update_cells\u003dFalse)"},{"line_number":249,"context_line":"        return result"},{"line_number":250,"context_line":""},{"line_number":251,"context_line":"    def _get_instance_nw_info(self, context, instance, **kwargs):"},{"line_number":252,"context_line":"        \"\"\"Template method, so a subclass can implement for neutron/network.\"\"\""},{"line_number":253,"context_line":"        raise NotImplementedError()"},{"line_number":254,"context_line":""}],"source_content_type":"text/x-python","patch_set":47,"id":"3afb71cf_5332ab11","line":251,"in_reply_to":"3afb71cf_6eee0724","updated":"2015-06-08 03:46:47.000000000","message":"It\u0027s used in neutronv2/api allocate_for_instance()\n\nhttps://github.com/openstack/nova/blob/master/nova/network/neutronv2/api.py#L672-L676\n\nand current patch L241","commit_id":"e79045ee63da495752da8c2e2f7d94dabda6319d"}],"nova/network/neutronv2/api.py":[{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"c21ed4434711886d648881d267e3f1467d85d18c","unresolved":false,"context_lines":[{"line_number":681,"context_line":"            # nova/neutron event reporting mechanism. See details:"},{"line_number":682,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1407664"},{"line_number":683,"context_line":"            if not (networks or port_ids):"},{"line_number":684,"context_line":"                instance \u003d objects.Instance.get_by_uuid(context,"},{"line_number":685,"context_line":"                                                        instance[\u0027uuid\u0027],"},{"line_number":686,"context_line":"                                                        use_slave\u003duse_slave)"},{"line_number":687,"context_line":"            result \u003d self._get_instance_nw_info(context, instance, networks,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_0f6f53fd","line":684,"updated":"2015-01-14 09:13:11.000000000","message":"dansmith add a comment to retrieve system_metadata in compute/manager.py but you code does not try to retrieve those information ?","commit_id":"0f9c3b4ec09d1e6e54eee256747ec79cfc94ad99"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d32e427074826b4d1acd680edfaf02c9ecc29b87","unresolved":false,"context_lines":[{"line_number":681,"context_line":"            # nova/neutron event reporting mechanism. See details:"},{"line_number":682,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1407664"},{"line_number":683,"context_line":"            if not (networks or port_ids):"},{"line_number":684,"context_line":"                instance \u003d objects.Instance.get_by_uuid(context,"},{"line_number":685,"context_line":"                                                        instance[\u0027uuid\u0027],"},{"line_number":686,"context_line":"                                                        use_slave\u003duse_slave)"},{"line_number":687,"context_line":"            result \u003d self._get_instance_nw_info(context, instance, networks,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a961159_6393684f","line":684,"in_reply_to":"3a961159_0f6f53fd","updated":"2015-01-15 07:44:07.000000000","message":"I\u0027m sorry, I lost it.\nThanks.","commit_id":"0f9c3b4ec09d1e6e54eee256747ec79cfc94ad99"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"c212d5ac422f46c4d691f967cea75957aa659881","unresolved":false,"context_lines":[{"line_number":682,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1407664"},{"line_number":683,"context_line":"            if not (networks or port_ids):"},{"line_number":684,"context_line":"                attrs \u003d [\u0027system_metadata\u0027]"},{"line_number":685,"context_line":"                instance \u003d objects.Instance.get_by_uuid(context,"},{"line_number":686,"context_line":"                                                        instance[\u0027uuid\u0027],"},{"line_number":687,"context_line":"                                                        expected_attrs\u003dattrs,"},{"line_number":688,"context_line":"                                                        use_slave\u003duse_slave)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_8554ad54","line":685,"updated":"2015-01-16 08:35:29.000000000","message":"In the manager we already call the method \u0027objects.Instance.get_by_uuid\u0027 in some conditions before to call this method. can we do something to avoid that double call?","commit_id":"b0ec5de8bd01a195b9f4eb9a25724290a79e9868"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"ae6fef099c2ff9ab49795401a20c91bb6bf24203","unresolved":false,"context_lines":[{"line_number":682,"context_line":"            # https://bugs.launchpad.net/nova/+bug/1407664"},{"line_number":683,"context_line":"            if not (networks or port_ids):"},{"line_number":684,"context_line":"                attrs \u003d [\u0027system_metadata\u0027]"},{"line_number":685,"context_line":"                instance \u003d objects.Instance.get_by_uuid(context,"},{"line_number":686,"context_line":"                                                        instance[\u0027uuid\u0027],"},{"line_number":687,"context_line":"                                                        expected_attrs\u003dattrs,"},{"line_number":688,"context_line":"                                                        use_slave\u003duse_slave)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3a961159_00631dab","line":685,"in_reply_to":"3a961159_8554ad54","updated":"2015-01-19 07:21:14.000000000","message":"Thanks, @sahid, I will try to refactor network.base_api.get_instance_nw_info in order to dispose locking and refreshing instance at the common path of neutron and nova-network.","commit_id":"b0ec5de8bd01a195b9f4eb9a25724290a79e9868"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"0014a3fd5beb1e85fdad8ad21963dbae14fc2e4a","unresolved":false,"context_lines":[{"line_number":670,"context_line":"           and update cache."},{"line_number":671,"context_line":"        \"\"\""},{"line_number":672,"context_line":"        return super(API, self).get_instance_nw_info(context, instance,"},{"line_number":673,"context_line":"                                                     **kwargs)"},{"line_number":674,"context_line":""},{"line_number":675,"context_line":"    def _get_instance_nw_info(self, context, instance, networks\u003dNone,"},{"line_number":676,"context_line":"                              port_ids\u003dNone, admin_client\u003dNone, **kwargs):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a930d6b_aeb7f3f3","line":673,"updated":"2015-01-26 11:36:14.000000000","message":"I don\u0027t think this is necessary, since it only does a super call. Remove it. :)\n\nIn the other class, in NetworkAPI, or how it was named, it made sense, since it had a decorator. Here it doesn\u0027t.","commit_id":"dbab315ee98e35cadd40e50009f77197b89e58ee"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"9617c620f7c8310b5c8f5409019eb37b249f2b26","unresolved":false,"context_lines":[{"line_number":670,"context_line":"           and update cache."},{"line_number":671,"context_line":"        \"\"\""},{"line_number":672,"context_line":"        return super(API, self).get_instance_nw_info(context, instance,"},{"line_number":673,"context_line":"                                                     **kwargs)"},{"line_number":674,"context_line":""},{"line_number":675,"context_line":"    def _get_instance_nw_info(self, context, instance, networks\u003dNone,"},{"line_number":676,"context_line":"                              port_ids\u003dNone, admin_client\u003dNone, **kwargs):"}],"source_content_type":"text/x-python","patch_set":13,"id":"1a930d6b_bfe45aac","line":673,"in_reply_to":"1a930d6b_aeb7f3f3","updated":"2015-01-28 02:42:50.000000000","message":"Done","commit_id":"dbab315ee98e35cadd40e50009f77197b89e58ee"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"c6631734e7332dafbc9c6adfc2d6a87424c84125","unresolved":false,"context_lines":[{"line_number":830,"context_line":""},{"line_number":831,"context_line":"    def _get_instance_nw_info(self, context, instance, networks\u003dNone,"},{"line_number":832,"context_line":"                              port_ids\u003dNone, admin_client\u003dNone,"},{"line_number":833,"context_line":"                              preexisting_port_ids\u003dNone, **kwargs):"},{"line_number":834,"context_line":"        # NOTE(danms): This is an inner method intended to be called"},{"line_number":835,"context_line":"        # by other code that updates instance nwinfo. It *must* be"},{"line_number":836,"context_line":"        # called with the refresh_cache-%(instance_uuid) lock held!"}],"source_content_type":"text/x-python","patch_set":47,"id":"5afe65bd_676dd397","line":833,"updated":"2015-06-03 12:03:08.000000000","message":"Makes sense to have added **kwargs to the base class.","commit_id":"e79045ee63da495752da8c2e2f7d94dabda6319d"}],"nova/tests/unit/api/openstack/compute/contrib/test_neutron_security_groups.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cf0e095a70f858378ab35c4ba8c36bfe6bf05de2","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                               return_value\u003ddb_inst):"},{"line_number":188,"context_line":"            with mock.patch.object(instance.info_cache, \u0027refresh\u0027):"},{"line_number":189,"context_line":"                neutron.allocate_for_instance(_context, instance,"},{"line_number":190,"context_line":"                                              security_groups\u003d[sg[\u0027id\u0027]])"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        req \u003d fakes.HTTPRequest.blank(\u0027/v2/fake/os-security-groups/%s\u0027"},{"line_number":193,"context_line":"                                      % sg[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":37,"id":"7aaa499b_bf68a1f6","line":190,"updated":"2015-04-13 17:31:27.000000000","message":"Why not verify that refresh was called?\n\nThat said, I\u0027m not entirely sure why refresh would get called in this chain. Can you explain?","commit_id":"106d3868003e68ce26e23426313b98af5855b5f9"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"898b7cea49c75abd27d3f0a81b0d194d3b4076a7","unresolved":false,"context_lines":[{"line_number":187,"context_line":"                               return_value\u003ddb_inst):"},{"line_number":188,"context_line":"            with mock.patch.object(instance.info_cache, \u0027refresh\u0027):"},{"line_number":189,"context_line":"                neutron.allocate_for_instance(_context, instance,"},{"line_number":190,"context_line":"                                              security_groups\u003d[sg[\u0027id\u0027]])"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"        req \u003d fakes.HTTPRequest.blank(\u0027/v2/fake/os-security-groups/%s\u0027"},{"line_number":193,"context_line":"                                      % sg[\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":37,"id":"7aaa499b_0bace59e","line":190,"in_reply_to":"7aaa499b_bf68a1f6","updated":"2015-04-14 06:18:58.000000000","message":"I add the \u0027instance.info_cache.refresh\u0027 logic in the base_api method \u0027get_instance_nw_info\u0027 in order to fix the race condition bug. You can find the detail in commit message.\n\nI will add a verify in next patch, thanks.","commit_id":"106d3868003e68ce26e23426313b98af5855b5f9"}],"nova/tests/unit/network/test_api.py":[{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"d9fefa2a6e7fcd3378b7b79160cf14a2695dc4bf","unresolved":false,"context_lines":[{"line_number":552,"context_line":"    @mock.patch.object(api.API, \u0027_get_instance_nw_info\u0027)"},{"line_number":553,"context_line":"    @mock.patch(\u0027nova.network.base_api.update_instance_cache_with_nw_info\u0027)"},{"line_number":554,"context_line":"    def test_get_instance_nw_info(self, mock_update, mock_get, mock_lock):"},{"line_number":555,"context_line":"        fake_result \u003d mock.sentinel"},{"line_number":556,"context_line":"        mock_get.return_value \u003d fake_result"},{"line_number":557,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":558,"context_line":"        result \u003d self.network_api.get_instance_nw_info(self.context, instance)"}],"source_content_type":"text/x-python","patch_set":47,"id":"3afb71cf_ae1abf6c","line":555,"range":{"start_line":555,"start_character":19,"end_line":555,"end_character":20},"updated":"2015-06-05 14:44:09.000000000","message":"mock.sentinel is the base object. Although this is not wrong, if you want to use sentinels properly, they should be something like this:\n\n    fake_result \u003d mock.sentinel.result","commit_id":"e79045ee63da495752da8c2e2f7d94dabda6319d"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"020477dfd6dda797521472efd775b1cd02432883","unresolved":false,"context_lines":[{"line_number":552,"context_line":"    @mock.patch.object(api.API, \u0027_get_instance_nw_info\u0027)"},{"line_number":553,"context_line":"    @mock.patch(\u0027nova.network.base_api.update_instance_cache_with_nw_info\u0027)"},{"line_number":554,"context_line":"    def test_get_instance_nw_info(self, mock_update, mock_get, mock_lock):"},{"line_number":555,"context_line":"        fake_result \u003d mock.sentinel"},{"line_number":556,"context_line":"        mock_get.return_value \u003d fake_result"},{"line_number":557,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":558,"context_line":"        result \u003d self.network_api.get_instance_nw_info(self.context, instance)"}],"source_content_type":"text/x-python","patch_set":47,"id":"3afb71cf_9635b1db","line":555,"in_reply_to":"3afb71cf_ae1abf6c","updated":"2015-06-08 03:46:47.000000000","message":"Done","commit_id":"e79045ee63da495752da8c2e2f7d94dabda6319d"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"cf0e095a70f858378ab35c4ba8c36bfe6bf05de2","unresolved":false,"context_lines":[{"line_number":608,"context_line":"            net_info_cache)"},{"line_number":609,"context_line":"        instance \u003d self._fake_instance_object_with_info_cache(self.instance)"},{"line_number":610,"context_line":"        self.mox.StubOutWithMock(instance.info_cache, \u0027refresh\u0027)"},{"line_number":611,"context_line":"        instance.info_cache.refresh().AndReturn(None)"},{"line_number":612,"context_line":"        self.mox.ReplayAll()"},{"line_number":613,"context_line":""},{"line_number":614,"context_line":"        nw_inf \u003d api.get_instance_nw_info(self.context, instance)"}],"source_content_type":"text/x-python","patch_set":37,"id":"7aaa499b_bf366101","line":611,"range":{"start_line":611,"start_character":37,"end_line":611,"end_character":53},"updated":"2015-04-13 17:31:27.000000000","message":"Do you really need the .AndReturn(None) ? Maybe I don\u0027t remember enough about mox, but I don\u0027t think you do.","commit_id":"106d3868003e68ce26e23426313b98af5855b5f9"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"898b7cea49c75abd27d3f0a81b0d194d3b4076a7","unresolved":false,"context_lines":[{"line_number":608,"context_line":"            net_info_cache)"},{"line_number":609,"context_line":"        instance \u003d self._fake_instance_object_with_info_cache(self.instance)"},{"line_number":610,"context_line":"        self.mox.StubOutWithMock(instance.info_cache, \u0027refresh\u0027)"},{"line_number":611,"context_line":"        instance.info_cache.refresh().AndReturn(None)"},{"line_number":612,"context_line":"        self.mox.ReplayAll()"},{"line_number":613,"context_line":""},{"line_number":614,"context_line":"        nw_inf \u003d api.get_instance_nw_info(self.context, instance)"}],"source_content_type":"text/x-python","patch_set":37,"id":"7aaa499b_5013bcb8","line":611,"in_reply_to":"7aaa499b_bf366101","updated":"2015-04-14 06:18:58.000000000","message":"you are right, we don\u0027t need that, thanks.","commit_id":"106d3868003e68ce26e23426313b98af5855b5f9"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"2ed1487479835fe93ab764cbeae24076c35a919d","unresolved":false,"context_lines":[{"line_number":788,"context_line":""},{"line_number":789,"context_line":"        instance \u003d self._fake_instance_object_with_info_cache(self.instance)"},{"line_number":790,"context_line":"        self.mox.StubOutWithMock(instance.info_cache, \u0027refresh\u0027)"},{"line_number":791,"context_line":"        instance.info_cache.refresh().AndReturn(None)"},{"line_number":792,"context_line":"        self.mox.ReplayAll()"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        nw_infs \u003d api.get_instance_nw_info(self.context,"}],"source_content_type":"text/x-python","patch_set":38,"id":"7aaa499b_2c5b3489","line":791,"updated":"2015-04-14 09:35:22.000000000","message":"I think Dan Smith complains about the AndReturn(None)","commit_id":"c669960589e07209237881e7236ad7499d5f5b22"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"19d31f0d4e18388f6333d509b609094dbea4e58b","unresolved":false,"context_lines":[{"line_number":788,"context_line":""},{"line_number":789,"context_line":"        instance \u003d self._fake_instance_object_with_info_cache(self.instance)"},{"line_number":790,"context_line":"        self.mox.StubOutWithMock(instance.info_cache, \u0027refresh\u0027)"},{"line_number":791,"context_line":"        instance.info_cache.refresh().AndReturn(None)"},{"line_number":792,"context_line":"        self.mox.ReplayAll()"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        nw_infs \u003d api.get_instance_nw_info(self.context,"}],"source_content_type":"text/x-python","patch_set":38,"id":"7aaa499b_eb352846","line":791,"in_reply_to":"7aaa499b_2c5b3489","updated":"2015-04-14 13:52:02.000000000","message":"Yeah to answer Dan\u0027s question, it\u0027s *not* necessary as the mocked method doesn\u0027t return anything.","commit_id":"c669960589e07209237881e7236ad7499d5f5b22"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"6969d56a2bc58cf5f10c7c21061c21ce00ea990b","unresolved":false,"context_lines":[{"line_number":788,"context_line":""},{"line_number":789,"context_line":"        instance \u003d self._fake_instance_object_with_info_cache(self.instance)"},{"line_number":790,"context_line":"        self.mox.StubOutWithMock(instance.info_cache, \u0027refresh\u0027)"},{"line_number":791,"context_line":"        instance.info_cache.refresh().AndReturn(None)"},{"line_number":792,"context_line":"        self.mox.ReplayAll()"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        nw_infs \u003d api.get_instance_nw_info(self.context,"}],"source_content_type":"text/x-python","patch_set":38,"id":"7aaa499b_ab75c798","line":791,"in_reply_to":"7aaa499b_eb352846","updated":"2015-04-15 03:15:11.000000000","message":"Done","commit_id":"c669960589e07209237881e7236ad7499d5f5b22"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"a6edcdb857c61555040e6ae03bd3c65f41051813","unresolved":false,"context_lines":[{"line_number":2829,"context_line":"                                            update_cells\u003dFalse)"},{"line_number":2830,"context_line":"        instance.info_cache.refresh.assert_called_once_with()"},{"line_number":2831,"context_line":"        self.assertEqual(fake_result, result)"},{"line_number":2832,"context_line":""},{"line_number":2833,"context_line":"    def _test_validate_networks_fixed_ip_no_dup(self, nets, requested_networks,"},{"line_number":2834,"context_line":"                                                ids, list_port_values):"},{"line_number":2835,"context_line":""}],"source_content_type":"text/x-python","patch_set":39,"id":"7aaa499b_ae32750e","line":2832,"updated":"2015-04-15 03:41:50.000000000","message":"Hi, Sylvain, I add new test case at here :)","commit_id":"adff8d3bb51c14d64cfc8b46b88c3949db085419"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"ee2e66900090721261036a9937a64f7c185ff3f3","unresolved":false,"context_lines":[{"line_number":2821,"context_line":"    def test_get_instance_nw_info(self, mock_update, mock_get, mock_lock):"},{"line_number":2822,"context_line":"        fake_result \u003d mock.sentinel"},{"line_number":2823,"context_line":"        mock_get.return_value \u003d fake_result"},{"line_number":2824,"context_line":"        instance \u003d mock.MagicMock()"},{"line_number":2825,"context_line":"        result \u003d self.api.get_instance_nw_info(self.context, instance)"},{"line_number":2826,"context_line":"        mock_get.assert_called_once_with(self.context, instance)"},{"line_number":2827,"context_line":"        mock_update.assert_called_once_with(self.api, self.context, instance,"}],"source_content_type":"text/x-python","patch_set":40,"id":"7aaa499b_6f3584f5","line":2824,"updated":"2015-04-15 08:31:24.000000000","message":"nit: You can probably use a real instance here and mock the method info_cache.refresh.\n\n  instance \u003d self._fake_instance_object_with_info_cache(self.instance)","commit_id":"2eb38d4926cde110b48f54dfd7c7e5a3fbc03b1f"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"d1fa81c80142a2b0f8e7a80a9e9b7c00dd7d779c","unresolved":false,"context_lines":[{"line_number":2821,"context_line":"    def test_get_instance_nw_info(self, mock_update, mock_get, mock_lock):"},{"line_number":2822,"context_line":"        fake_result \u003d mock.sentinel"},{"line_number":2823,"context_line":"        mock_get.return_value \u003d fake_result"},{"line_number":2824,"context_line":"        instance \u003d mock.MagicMock()"},{"line_number":2825,"context_line":"        result \u003d self.api.get_instance_nw_info(self.context, instance)"},{"line_number":2826,"context_line":"        mock_get.assert_called_once_with(self.context, instance)"},{"line_number":2827,"context_line":"        mock_update.assert_called_once_with(self.api, self.context, instance,"}],"source_content_type":"text/x-python","patch_set":40,"id":"7aaa499b_8390a744","line":2824,"in_reply_to":"7aaa499b_6f3584f5","updated":"2015-04-15 10:22:12.000000000","message":"I can\u0027t use these methods \u0027_fake_instance_object_with_info_cache\u0027 and \u0027_fake_instance_info_cache\u0027 in class TestNeutronv2WithMock, so I use this simple way :)","commit_id":"2eb38d4926cde110b48f54dfd7c7e5a3fbc03b1f"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"054197335dd5aaafd4e5ecbc85964f6d4666933d","unresolved":false,"context_lines":[{"line_number":2821,"context_line":"    def test_get_instance_nw_info(self, mock_update, mock_get, mock_lock):"},{"line_number":2822,"context_line":"        fake_result \u003d mock.sentinel"},{"line_number":2823,"context_line":"        mock_get.return_value \u003d fake_result"},{"line_number":2824,"context_line":"        instance \u003d mock.MagicMock()"},{"line_number":2825,"context_line":"        result \u003d self.api.get_instance_nw_info(self.context, instance)"},{"line_number":2826,"context_line":"        mock_get.assert_called_once_with(self.context, instance)"},{"line_number":2827,"context_line":"        mock_update.assert_called_once_with(self.api, self.context, instance,"}],"source_content_type":"text/x-python","patch_set":40,"id":"7aaa499b_5486d765","line":2824,"in_reply_to":"7aaa499b_8390a744","updated":"2015-04-15 11:33:04.000000000","message":"I see, i guess it\u0027s not big deal and a clean can be done in a new change.","commit_id":"2eb38d4926cde110b48f54dfd7c7e5a3fbc03b1f"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"d9fefa2a6e7fcd3378b7b79160cf14a2695dc4bf","unresolved":false,"context_lines":[{"line_number":2873,"context_line":"    @mock.patch.object(neutronapi.API, \u0027_get_instance_nw_info\u0027)"},{"line_number":2874,"context_line":"    @mock.patch(\u0027nova.network.base_api.update_instance_cache_with_nw_info\u0027)"},{"line_number":2875,"context_line":"    def test_get_instance_nw_info(self, mock_update, mock_get, mock_lock):"},{"line_number":2876,"context_line":"        fake_result \u003d mock.sentinel"},{"line_number":2877,"context_line":"        mock_get.return_value \u003d fake_result"},{"line_number":2878,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":2879,"context_line":"        result \u003d self.api.get_instance_nw_info(self.context, instance)"}],"source_content_type":"text/x-python","patch_set":47,"id":"3afb71cf_eb09c932","line":2876,"updated":"2015-06-05 14:44:09.000000000","message":"mock.sentinel is the base object. Although this is not wrong, if you want to use sentinels properly, they should be something like this:\n\n    fake_result \u003d mock.sentinel.result","commit_id":"e79045ee63da495752da8c2e2f7d94dabda6319d"},{"author":{"_account_id":8276,"name":"kiwik","email":"chenrui.momo@gmail.com","username":"kiwik"},"change_message_id":"020477dfd6dda797521472efd775b1cd02432883","unresolved":false,"context_lines":[{"line_number":2873,"context_line":"    @mock.patch.object(neutronapi.API, \u0027_get_instance_nw_info\u0027)"},{"line_number":2874,"context_line":"    @mock.patch(\u0027nova.network.base_api.update_instance_cache_with_nw_info\u0027)"},{"line_number":2875,"context_line":"    def test_get_instance_nw_info(self, mock_update, mock_get, mock_lock):"},{"line_number":2876,"context_line":"        fake_result \u003d mock.sentinel"},{"line_number":2877,"context_line":"        mock_get.return_value \u003d fake_result"},{"line_number":2878,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"},{"line_number":2879,"context_line":"        result \u003d self.api.get_instance_nw_info(self.context, instance)"}],"source_content_type":"text/x-python","patch_set":47,"id":"3afb71cf_564e1970","line":2876,"in_reply_to":"3afb71cf_eb09c932","updated":"2015-06-08 03:46:47.000000000","message":"Done","commit_id":"e79045ee63da495752da8c2e2f7d94dabda6319d"}]}
