)]}'
{"heat/engine/resources/openstack/nova/server.py":[{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"0c4199ea41a1dce90d264968f6157c6272f26092","unresolved":false,"context_lines":[{"line_number":636,"context_line":"              \u0027addresses, \u003cnetwork name_or_id\u003e, 0, port]}``. The subnets may \u0027"},{"line_number":637,"context_line":"              \u0027be obtained trough the following expression: ``{get_attr: \u0027"},{"line_number":638,"context_line":"              \u0027[\u003cserver\u003e, addresses, \u003cnetwork name_or_id\u003e, 0, subnets]}``. \u0027"},{"line_number":639,"context_line":"              \u0027The network may be obtained trough the following expression: \u0027"},{"line_number":640,"context_line":"              \u0027``{get_attr: [\u003cserver\u003e, addresses, \u003cnetwork name_or_id\u003e, 0, \u0027"},{"line_number":641,"context_line":"              \u0027network]}``.\u0027),"},{"line_number":642,"context_line":"            type\u003dattributes.Schema.MAP,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_3002fa70","line":639,"range":{"start_line":639,"start_character":43,"end_line":639,"end_character":49},"updated":"2018-06-07 14:00:23.000000000","message":"typo: through","commit_id":"91193b33104cbf5fe9a160d5800db923174d8d80"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"e4f0b1173ffec31a05737924da35b8bc7718747b","unresolved":false,"context_lines":[{"line_number":636,"context_line":"              \u0027addresses, \u003cnetwork name_or_id\u003e, 0, port]}``. The subnets may \u0027"},{"line_number":637,"context_line":"              \u0027be obtained trough the following expression: ``{get_attr: \u0027"},{"line_number":638,"context_line":"              \u0027[\u003cserver\u003e, addresses, \u003cnetwork name_or_id\u003e, 0, subnets]}``. \u0027"},{"line_number":639,"context_line":"              \u0027The network may be obtained trough the following expression: \u0027"},{"line_number":640,"context_line":"              \u0027``{get_attr: [\u003cserver\u003e, addresses, \u003cnetwork name_or_id\u003e, 0, \u0027"},{"line_number":641,"context_line":"              \u0027network]}``.\u0027),"},{"line_number":642,"context_line":"            type\u003dattributes.Schema.MAP,"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_83a621ab","line":639,"range":{"start_line":639,"start_character":43,"end_line":639,"end_character":49},"in_reply_to":"5f7c97a3_3002fa70","updated":"2018-06-07 17:37:58.000000000","message":"Done","commit_id":"91193b33104cbf5fe9a160d5800db923174d8d80"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"0c4199ea41a1dce90d264968f6157c6272f26092","unresolved":false,"context_lines":[{"line_number":1109,"context_line":"        try:"},{"line_number":1110,"context_line":"            return self.client(\u0027neutron\u0027).show_network("},{"line_number":1111,"context_line":"                self.client(\u0027neutron\u0027).show_port("},{"line_number":1112,"context_line":"                    port_id)[\u0027port\u0027][\u0027network_id\u0027])[\u0027network\u0027]"},{"line_number":1113,"context_line":"        except Exception as ex:"},{"line_number":1114,"context_line":"            LOG.warning(\"Failed to fetch resource attributes: %s\", ex)"},{"line_number":1115,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_f066c255","line":1112,"updated":"2018-06-07 14:00:23.000000000","message":"It\u0027s inefficient to call show_port() both here and in _get_port_subnets_attr(), when each is called one after another. Let\u0027s refactor so we only have to call it once.","commit_id":"91193b33104cbf5fe9a160d5800db923174d8d80"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"e4f0b1173ffec31a05737924da35b8bc7718747b","unresolved":false,"context_lines":[{"line_number":1109,"context_line":"        try:"},{"line_number":1110,"context_line":"            return self.client(\u0027neutron\u0027).show_network("},{"line_number":1111,"context_line":"                self.client(\u0027neutron\u0027).show_port("},{"line_number":1112,"context_line":"                    port_id)[\u0027port\u0027][\u0027network_id\u0027])[\u0027network\u0027]"},{"line_number":1113,"context_line":"        except Exception as ex:"},{"line_number":1114,"context_line":"            LOG.warning(\"Failed to fetch resource attributes: %s\", ex)"},{"line_number":1115,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_23b70ddb","line":1112,"in_reply_to":"5f7c97a3_f066c255","updated":"2018-06-07 17:37:58.000000000","message":"Done","commit_id":"91193b33104cbf5fe9a160d5800db923174d8d80"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"a855df5087666f408ad968e45b41fe7c94beeceb","unresolved":false,"context_lines":[{"line_number":1096,"context_line":"            return self.client(\u0027neutron\u0027).show_port(port_id)[\u0027port\u0027]"},{"line_number":1097,"context_line":"        except Exception as ex:"},{"line_number":1098,"context_line":"            LOG.warning(\"Failed to fetch resource attributes: %s\", ex)"},{"line_number":1099,"context_line":"            return"},{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"    def _get_subnets_attr(self, fixed_ips):"},{"line_number":1102,"context_line":"        subnets \u003d []"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_5f73e380","line":1099,"updated":"2018-06-08 19:35:19.000000000","message":"So in this case we\u0027ll return None, which means we\u0027ll fail with an exception on line 1145. That\u0027s a change in behaviour from _get_port_network_attr() where it just set the network value to None in the output.\n\nIt\u0027ll probably be easier to do the error handling for this if it is moved inline. It\u0027s only called from one place anyway.\n\nI guess it\u0027d be a nice bonus if we had a test case that covered this.","commit_id":"356ca6d1a6f9eacbc7316d8ea888b5f4ef5824c4"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"95df0a91d1cea287e78f3640b4a6917d5332b981","unresolved":false,"context_lines":[{"line_number":1096,"context_line":"            return self.client(\u0027neutron\u0027).show_port(port_id)[\u0027port\u0027]"},{"line_number":1097,"context_line":"        except Exception as ex:"},{"line_number":1098,"context_line":"            LOG.warning(\"Failed to fetch resource attributes: %s\", ex)"},{"line_number":1099,"context_line":"            return"},{"line_number":1100,"context_line":""},{"line_number":1101,"context_line":"    def _get_subnets_attr(self, fixed_ips):"},{"line_number":1102,"context_line":"        subnets \u003d []"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_063c2ddf","line":1099,"in_reply_to":"5f7c97a3_5f73e380","updated":"2018-06-11 08:51:23.000000000","message":"Good catch! I removed the _get_port function and moved the show_port call into _add_attrs_for_addresses.\nAlso added a test wiht show_port patched to raise NotFound.","commit_id":"356ca6d1a6f9eacbc7316d8ea888b5f4ef5824c4"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"e4f0b1173ffec31a05737924da35b8bc7718747b","unresolved":false,"context_lines":[{"line_number":1139,"context_line":"                # We don\u0027t need to get subnets and network in that case. Only"},{"line_number":1140,"context_line":"                # do the external calls if extend_networks is true, i.e called"},{"line_number":1141,"context_line":"                # from _resolve_attribute()"},{"line_number":1142,"context_line":"                if not extend_networks:"},{"line_number":1143,"context_line":"                    continue"},{"line_number":1144,"context_line":"                port \u003d self._get_port(addr[\u0027port\u0027])"},{"line_number":1145,"context_line":"                addr[\u0027subnets\u0027] \u003d self._get_subnets_attr(port[\u0027fixed_ips\u0027])"},{"line_number":1146,"context_line":"                addr[\u0027network\u0027] \u003d self._get_network_attr(port[\u0027network_id\u0027])"}],"source_content_type":"text/x-python","patch_set":5,"id":"5f7c97a3_c39c195d","line":1143,"range":{"start_line":1142,"start_character":16,"end_line":1143,"end_character":28},"updated":"2018-06-07 17:37:58.000000000","message":"I inverted so that the coming few lines can be un-indented and fit on one line.","commit_id":"356ca6d1a6f9eacbc7316d8ea888b5f4ef5824c4"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"02626cf0f50ebf0e246813d1467ab947db1c4272","unresolved":false,"context_lines":[{"line_number":1123,"context_line":"                        addr[\u0027port\u0027])[\u0027port\u0027]"},{"line_number":1124,"context_line":"                except Exception as ex:"},{"line_number":1125,"context_line":"                    addr[\u0027subnets\u0027], addr[\u0027network\u0027] \u003d None, None"},{"line_number":1126,"context_line":"                    LOG.warning(\"Failed to fetch resource attributes: %s\", ex)"},{"line_number":1127,"context_line":"                    continue"},{"line_number":1128,"context_line":"                addr[\u0027subnets\u0027] \u003d self._get_subnets_attr(port[\u0027fixed_ips\u0027])"},{"line_number":1129,"context_line":"                addr[\u0027network\u0027] \u003d self._get_network_attr(port[\u0027network_id\u0027])"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f7c97a3_ff19c18a","line":1126,"range":{"start_line":1126,"start_character":24,"end_line":1126,"end_character":31},"updated":"2018-07-25 15:54:21.000000000","message":"I\u0027m not sure this rises to the level of warning per https://specs.openstack.org/openstack/openstack-specs/specs/log-guidelines.html#definition-of-log-levels","commit_id":"30d63c5b63211dbea5991f66a0d4086ec0488b0f"}]}
