)]}'
{"heat/engine/resources/openstack/neutron/subnet.py":[{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"a7137be5624b047cc8a0e10cc32dd03896af481d","unresolved":false,"context_lines":[{"line_number":403,"context_line":"        else:"},{"line_number":404,"context_line":"            return True"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    def _validate_segment_update_supported(self):"},{"line_number":407,"context_line":"        msg1, msg2 \u003d str(), str()"},{"line_number":408,"context_line":"        network \u003d self.client(\u0027neutron\u0027).show_network("},{"line_number":409,"context_line":"            self._show_resource().get(\u0027network_id\u0027))[\u0027network\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_e8c26053","line":406,"range":{"start_line":406,"start_character":8,"end_line":406,"end_character":42},"updated":"2018-06-07 08:54:03.000000000","message":"add a unit test","commit_id":"c0a45839489fe50a597b5d57a6eb37b52ab76ee3"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"06426daaed4db01d5f2c47b3681679193245a83e","unresolved":false,"context_lines":[{"line_number":403,"context_line":"        else:"},{"line_number":404,"context_line":"            return True"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    def _validate_segment_update_supported(self):"},{"line_number":407,"context_line":"        msg1, msg2 \u003d str(), str()"},{"line_number":408,"context_line":"        network \u003d self.client(\u0027neutron\u0027).show_network("},{"line_number":409,"context_line":"            self._show_resource().get(\u0027network_id\u0027))[\u0027network\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_ce8430d6","line":406,"range":{"start_line":406,"start_character":8,"end_line":406,"end_character":42},"in_reply_to":"5f7c97a3_89e5d70c","updated":"2018-06-08 10:35:52.000000000","message":"Thanks Rabi.\n\nI agree, the extra calls are not neccecary. Neutron will fail with proper errors. I will remove all but the self.properties[self.SEGMENT] is not None check.","commit_id":"c0a45839489fe50a597b5d57a6eb37b52ab76ee3"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"a8103f2fed3799e8e37ce1d88618f51b782f2107","unresolved":false,"context_lines":[{"line_number":403,"context_line":"        else:"},{"line_number":404,"context_line":"            return True"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    def _validate_segment_update_supported(self):"},{"line_number":407,"context_line":"        msg1, msg2 \u003d str(), str()"},{"line_number":408,"context_line":"        network \u003d self.client(\u0027neutron\u0027).show_network("},{"line_number":409,"context_line":"            self._show_resource().get(\u0027network_id\u0027))[\u0027network\u0027]"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_89e5d70c","line":406,"range":{"start_line":406,"start_character":8,"end_line":406,"end_character":42},"in_reply_to":"5f7c97a3_e8c26053","updated":"2018-06-08 04:21:29.000000000","message":"Hmm.. we\u0027re now making 2 API calls to avoid that one update API call which would anyway fail in neutron with proper error, I suppose.\n\nBtw, we don\u0027t even check for availability of extensions when validating for segment constraint. The only place we do that is when checking for service availability when loading resource plugins[1].\n\nSo if the segments extension is not available we get something like:\n\nERROR: Property error: : resources.subnet.properties.segment: : NotFoundException: 404\n\nIMO we can just have an additional self.properties[self.SEGMENT] is not None check, which does not involve API calls and avoid the complexity here.\n\n\nhttps://github.com/openstack/heat/blob/master/heat/engine/resource.py#L811","commit_id":"c0a45839489fe50a597b5d57a6eb37b52ab76ee3"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"06426daaed4db01d5f2c47b3681679193245a83e","unresolved":false,"context_lines":[{"line_number":409,"context_line":"            self._show_resource().get(\u0027network_id\u0027))[\u0027network\u0027]"},{"line_number":410,"context_line":"        segments \u003d list(self.client(\u0027openstack\u0027).network.segments("},{"line_number":411,"context_line":"            network_id\u003dnetwork[\u0027id\u0027]))"},{"line_number":412,"context_line":"        # Neutron subnet-segmentid-writable api extension must be available"},{"line_number":413,"context_line":"        if (\u0027subnet-segmentid-writable\u0027 not in"},{"line_number":414,"context_line":"                [ext[\u0027alias\u0027] for ext in"},{"line_number":415,"context_line":"                 self.client(\u0027neutron\u0027).list_extensions()[\u0027extensions\u0027]]):"},{"line_number":416,"context_line":"            msg \u003d _(\u0027Updating the segment_id requires neutron api extension \u0027"},{"line_number":417,"context_line":"                    \u0027subnet-segmentid-writable.\u0027)"},{"line_number":418,"context_line":"            raise exception.NotSupported(message\u003dmsg)"},{"line_number":419,"context_line":""},{"line_number":420,"context_line":"        # Current segment id must be None"},{"line_number":421,"context_line":"        if self.properties[self.SEGMENT] is not None:"}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_6e02bc40","line":418,"range":{"start_line":412,"start_character":0,"end_line":418,"end_character":53},"updated":"2018-06-08 10:35:52.000000000","message":"We may want to do a follow up that calls list_extensions when heat is started. We then have that cached and can do validations like this (also in other places) without doing the additional external call to get the list of extensions in neutron over and over.\n\nI left the validate_segment_update_supported function here in case we want to add this at some point.","commit_id":"c0a45839489fe50a597b5d57a6eb37b52ab76ee3"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"a7137be5624b047cc8a0e10cc32dd03896af481d","unresolved":false,"context_lines":[{"line_number":426,"context_line":"        # Update not allowed if multiple subnets or segments on the network"},{"line_number":427,"context_line":"        if len(network[\u0027subnets\u0027]) \u003e 1 or len(segments) \u003e 1:"},{"line_number":428,"context_line":"            msg2 \u003d _(\u0027The network %s have multiple subnets and/or multiple \u0027"},{"line_number":429,"context_line":"                     \u0027segments. Updating the subnet segment assciation is \u0027"},{"line_number":430,"context_line":"                     \u0027only allowed when the network have one segment and one \u0027"},{"line_number":431,"context_line":"                     \u0027subnet.\u0027) % network[\u0027id\u0027]"},{"line_number":432,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5f7c97a3_08cebc82","line":429,"range":{"start_line":429,"start_character":60,"end_line":429,"end_character":70},"updated":"2018-06-07 08:54:03.000000000","message":"typo","commit_id":"c0a45839489fe50a597b5d57a6eb37b52ab76ee3"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"2d6addd6057664b1aff6112c95eee1170571a728","unresolved":false,"context_lines":[{"line_number":412,"context_line":"        if self.properties[self.SEGMENT] is not None:"},{"line_number":413,"context_line":"            msg \u003d _(\u0027Updating the subnet segment assciation only allowed \u0027"},{"line_number":414,"context_line":"                    \u0027when the current segment_id is None. The subnet is \u0027"},{"line_number":415,"context_line":"                    \u0027currently associated with segment. In this state update\u0027)"},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"        if msg:"},{"line_number":418,"context_line":"            raise exception.ResourceActionNotSupported(action\u003dmsg)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_8c59605c","line":415,"range":{"start_line":415,"start_character":55,"end_line":415,"end_character":76},"updated":"2018-06-08 10:38:41.000000000","message":"This looks a bit strange, leaving a sentance with no termination. The full error would look like this:\n\n\"Updating the subnet segment assciation only allowed when the current segment_id is None. The subnet is currently associated with segment. In this state update is not supported for resource.\"\n\nclass ResourceActionNotSupported(HeatException):\n    msg_fmt \u003d _(\"%(action)s is not supported for resource.\")","commit_id":"50604d42b3075a18e554b2caa548224f5f300605"},{"author":{"_account_id":7385,"name":"Thomas Herve","email":"therve@redhat.com","username":"therve"},"change_message_id":"66855208e9dddf40661a435a9a4d63cb642aed74","unresolved":false,"context_lines":[{"line_number":415,"context_line":"                    \u0027currently associated with segment. In this state update\u0027)"},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"        if msg:"},{"line_number":418,"context_line":"            raise exception.ResourceActionNotSupported(action\u003dmsg)"},{"line_number":419,"context_line":"        else:"},{"line_number":420,"context_line":"            return True"},{"line_number":421,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_53040418","line":418,"range":{"start_line":418,"start_character":65,"end_line":418,"end_character":66},"updated":"2018-06-12 13:42:38.000000000","message":"Can we put the raise directly above? I don\u0027t see the point of the msg variable check.","commit_id":"b5dc11ebad7a3a6aa26790c9cf257cb2d4baae5e"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"27bc931b3f1c50351bc205f6f8fd74290a94fca0","unresolved":false,"context_lines":[{"line_number":415,"context_line":"                    \u0027currently associated with segment. In this state update\u0027)"},{"line_number":416,"context_line":""},{"line_number":417,"context_line":"        if msg:"},{"line_number":418,"context_line":"            raise exception.ResourceActionNotSupported(action\u003dmsg)"},{"line_number":419,"context_line":"        else:"},{"line_number":420,"context_line":"            return True"},{"line_number":421,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5f7c97a3_22000c01","line":418,"range":{"start_line":418,"start_character":65,"end_line":418,"end_character":66},"in_reply_to":"5f7c97a3_53040418","updated":"2018-06-12 15:52:40.000000000","message":"Done","commit_id":"b5dc11ebad7a3a6aa26790c9cf257cb2d4baae5e"},{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"6c6e032ca0f2add6aa3ff2502fb759e280c7e08e","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            constraints\u003d["},{"line_number":243,"context_line":"                constraints.CustomConstraint(\u0027neutron.segment\u0027)"},{"line_number":244,"context_line":"            ],"},{"line_number":245,"context_line":"            update_allowed\u003dTrue,"},{"line_number":246,"context_line":"            support_status\u003dsupport.SupportStatus(version\u003d\u00279.0.0\u0027)"},{"line_number":247,"context_line":"        ),"},{"line_number":248,"context_line":"        TAGS: properties.Schema("}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_aa986568","line":245,"range":{"start_line":245,"start_character":12,"end_line":245,"end_character":31},"updated":"2018-06-13 04:34:48.000000000","message":"Should we add a support status message mentioning that update is allowed from 11.0.0?","commit_id":"c5a54ca7463042874a0627df41db6815092de942"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"724231773bc34231fcd1ac1977b8b8bf35ae644b","unresolved":false,"context_lines":[{"line_number":242,"context_line":"            constraints\u003d["},{"line_number":243,"context_line":"                constraints.CustomConstraint(\u0027neutron.segment\u0027)"},{"line_number":244,"context_line":"            ],"},{"line_number":245,"context_line":"            update_allowed\u003dTrue,"},{"line_number":246,"context_line":"            support_status\u003dsupport.SupportStatus(version\u003d\u00279.0.0\u0027)"},{"line_number":247,"context_line":"        ),"},{"line_number":248,"context_line":"        TAGS: properties.Schema("}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_b39bfd14","line":245,"range":{"start_line":245,"start_character":12,"end_line":245,"end_character":31},"in_reply_to":"5f7c97a3_aa986568","updated":"2018-06-13 11:16:18.000000000","message":"Yes, good idea.\nDone.","commit_id":"c5a54ca7463042874a0627df41db6815092de942"},{"author":{"_account_id":12404,"name":"Rico Lin","email":"ricolin@ricolky.com","username":"rico.lin"},"change_message_id":"63e33066bd494065a10780431b561ed0b57c6f5a","unresolved":false,"context_lines":[{"line_number":430,"context_line":"            if (self.ALLOCATION_POOLS in prop_diff and"},{"line_number":431,"context_line":"                    prop_diff[self.ALLOCATION_POOLS] is None):"},{"line_number":432,"context_line":"                prop_diff[self.ALLOCATION_POOLS] \u003d []"},{"line_number":433,"context_line":"            if (self.SEGMENT in prop_diff and prop_diff[self.SEGMENT] and"},{"line_number":434,"context_line":"                    self._validate_segment_update_supported()):"},{"line_number":435,"context_line":"                prop_diff[\u0027segment_id\u0027] \u003d prop_diff.pop(self.SEGMENT)"},{"line_number":436,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"5f7c97a3_ec486263","line":433,"range":{"start_line":433,"start_character":16,"end_line":433,"end_character":69},"updated":"2018-06-29 02:07:41.000000000","message":"just `prop_diff.get(self.SEGMENT)`","commit_id":"066f95815a302b46ab9402ed5fde6e27cd67af17"}]}
