)]}'
{"heat/engine/resources/openstack/heat/resource_chain.py":[{"author":{"_account_id":8833,"name":"Rabi Mishra","email":"ramishra@redhat.com","username":"rabi"},"change_message_id":"05292556b19ca76c3e044ea2672898833724f0fc","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        return [grouputils.get_rsrc_attr(self, key, False, n, *path)"},{"line_number":173,"context_line":"                for n in names]"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def _nested_output_defns(self, resource_names, get_attr_fn):"},{"line_number":176,"context_line":"        for attr in self.referenced_attrs():"},{"line_number":177,"context_line":"            if isinstance(attr, six.string_types):"},{"line_number":178,"context_line":"                key, path \u003d attr, []"},{"line_number":179,"context_line":"                output_name \u003d attr"},{"line_number":180,"context_line":"            else:"},{"line_number":181,"context_line":"                key, path \u003d attr[0], list(attr[1:])"},{"line_number":182,"context_line":"                output_name \u003d \u0027, \u0027.join(attr)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            if key.startswith(\"resource.\"):"},{"line_number":185,"context_line":"                keycomponents \u003d key.split(\u0027.\u0027, 2)"},{"line_number":186,"context_line":"                res_name \u003d keycomponents[1]"},{"line_number":187,"context_line":"                attr_name \u003d keycomponents[2:]"},{"line_number":188,"context_line":"                if attr_name and (res_name in resource_names):"},{"line_number":189,"context_line":"                    value \u003d get_attr_fn([res_name] + attr_name + path)"},{"line_number":190,"context_line":"                    yield output.OutputDefinition(output_name, value)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            elif key \u003d\u003d self.ATTR_ATTRIBUTES and path:"},{"line_number":193,"context_line":"                value \u003d {r: get_attr_fn([r] + path) for r in resource_names}"},{"line_number":194,"context_line":"                yield output.OutputDefinition(output_name, value)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"            elif key not in self.ATTRIBUTES:"},{"line_number":197,"context_line":"                value \u003d [get_attr_fn([r, key] + path) for r in resource_names]"},{"line_number":198,"context_line":"                yield output.OutputDefinition(output_name, value)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    @staticmethod"},{"line_number":201,"context_line":"    def _resource_names(resource_types):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_408d2630","line":198,"range":{"start_line":175,"start_character":0,"end_line":198,"end_character":65},"updated":"2017-07-06 05:18:29.000000000","message":"This looks same to me for RG, RC and native ASG unless I miss something. Can we not have this in StackResource, or we expect them to be different over time? \n\nI assume you defined this in all group resources because of the inheritance messs with InstanceGroup (where it\u0027s different). May be we can just overide it in IG and native ASG?","commit_id":"77b059517ba97f60999be5f14d6b5b9e0600e20e"},{"author":{"_account_id":4257,"name":"Zane Bitter","email":"zbitter@redhat.com","username":"zaneb"},"change_message_id":"ea5bb93d12cd8540334e39380ac126572b7ce240","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        return [grouputils.get_rsrc_attr(self, key, False, n, *path)"},{"line_number":173,"context_line":"                for n in names]"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def _nested_output_defns(self, resource_names, get_attr_fn):"},{"line_number":176,"context_line":"        for attr in self.referenced_attrs():"},{"line_number":177,"context_line":"            if isinstance(attr, six.string_types):"},{"line_number":178,"context_line":"                key, path \u003d attr, []"},{"line_number":179,"context_line":"                output_name \u003d attr"},{"line_number":180,"context_line":"            else:"},{"line_number":181,"context_line":"                key, path \u003d attr[0], list(attr[1:])"},{"line_number":182,"context_line":"                output_name \u003d \u0027, \u0027.join(attr)"},{"line_number":183,"context_line":""},{"line_number":184,"context_line":"            if key.startswith(\"resource.\"):"},{"line_number":185,"context_line":"                keycomponents \u003d key.split(\u0027.\u0027, 2)"},{"line_number":186,"context_line":"                res_name \u003d keycomponents[1]"},{"line_number":187,"context_line":"                attr_name \u003d keycomponents[2:]"},{"line_number":188,"context_line":"                if attr_name and (res_name in resource_names):"},{"line_number":189,"context_line":"                    value \u003d get_attr_fn([res_name] + attr_name + path)"},{"line_number":190,"context_line":"                    yield output.OutputDefinition(output_name, value)"},{"line_number":191,"context_line":""},{"line_number":192,"context_line":"            elif key \u003d\u003d self.ATTR_ATTRIBUTES and path:"},{"line_number":193,"context_line":"                value \u003d {r: get_attr_fn([r] + path) for r in resource_names}"},{"line_number":194,"context_line":"                yield output.OutputDefinition(output_name, value)"},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"            elif key not in self.ATTRIBUTES:"},{"line_number":197,"context_line":"                value \u003d [get_attr_fn([r, key] + path) for r in resource_names]"},{"line_number":198,"context_line":"                yield output.OutputDefinition(output_name, value)"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    @staticmethod"},{"line_number":201,"context_line":"    def _resource_names(resource_types):"}],"source_content_type":"text/x-python","patch_set":9,"id":"3f1d235d_2ea89bd9","line":198,"range":{"start_line":175,"start_character":0,"end_line":198,"end_character":65},"in_reply_to":"3f1d235d_408d2630","updated":"2017-07-07 14:57:46.000000000","message":"RG and RC are the same I believe, but they\u0027re not in the same inheritance hierarchy other than obviously inheriting from StackResource (which wouldn\u0027t be an appropriate place for this). The native ASG implementation is different, and as you said the InstanceGroup one is different again.\n\nThe key here is that the implementation of _nested_output_definitions() must match that of get_attribute(). And all of these classes have separate (and different) get_attribute() definitions. For that reason, I think it makes sense to keep the implementation right next to the get_attribute() implementation it has to match, even if it means duplicating some code.\n\nI expect these implementations to diverge in the future - e.g. ResourceGroup has a different get_attribute() to ResourceChain (it has a REFS_MAP attribute and ResourceChain doesn\u0027t) in ways that don\u0027t matter for the purposes of this patch (getting all the attributes cached properly) but might in future (e.g. if we decide to start getting attribute values from the nested stack outputs).","commit_id":"77b059517ba97f60999be5f14d6b5b9e0600e20e"}]}
