def dep_attrs(self, resource_name): """ Return an iterator over dependent attributes for specified resource_name in resources' properties and metadata fields. """ return itertools.chain( function.dep_attrs(self._properties, resource_name), function.dep_attrs(self._metadata, resource_name))
def dep_attrs(self, resource_name): """Iterate over attributes of a given resource that this references. Return an iterator over dependent attributes for specified resource_name in resources' properties and metadata fields. """ return itertools.chain( function.dep_attrs(self._properties, resource_name), function.dep_attrs(self._metadata, resource_name) )
def dep_attrs(self, resource_name): """Iterate over attributes of a given resource that this references. Return an iterator over dependent attributes for specified resource_name in the output's value field. """ return function.dep_attrs(self._value, resource_name)
def dep_attrs(self, resource_name): """Check if there is no attribute_name defined, return empty chain.""" if self._attribute is not None: return super(GetAttAllAttributes, self).dep_attrs(resource_name) elif self._resource().name == resource_name: res = self._resource() attrs = six.iterkeys(res.attributes_schema) else: attrs = [] return itertools.chain(function.dep_attrs(self.args, resource_name), attrs)
def dep_attrs(self, resource_name): """Check if there is no attribute_name defined, return empty chain.""" if self._attribute is not None: return super(GetAttAllAttributes, self).dep_attrs(resource_name) elif self._res_name() == resource_name: attrs = [attributes.ALL_ATTRIBUTES] else: attrs = [] return itertools.chain(function.dep_attrs(self.args, resource_name), attrs)
def dep_attrs(self, resource_name, load_all=False): """Iterate over attributes of a given resource that this references. Return an iterator over dependent attributes for specified resource_name in resources' properties and metadata fields. """ if self._all_dep_attrs is None and load_all: attr_map = collections.defaultdict(set) atts = itertools.chain(function.all_dep_attrs(self._properties), function.all_dep_attrs(self._metadata)) for res_name, att_name in atts: attr_map[res_name].add(att_name) self._all_dep_attrs = attr_map if self._all_dep_attrs is not None: return self._all_dep_attrs[resource_name] return itertools.chain( function.dep_attrs(self._properties, resource_name), function.dep_attrs(self._metadata, resource_name))
def dep_attrs(self, resource_name): if self._resource().name == resource_name: path = function.resolve(self._path_components) attr = [function.resolve(self._attribute)] if path: attrs = [tuple(attr + path)] else: attrs = attr else: attrs = [] return itertools.chain(function.dep_attrs(self.args, resource_name), attrs)
def dep_attrs(self, resource_name, load_all=False): """Iterate over attributes of a given resource that this references. Return an iterator over dependent attributes for specified resource_name in resources' properties and metadata fields. """ if self._all_dep_attrs is None and load_all: attr_map = collections.defaultdict(set) atts = itertools.chain(function.all_dep_attrs(self._properties), function.all_dep_attrs(self._metadata)) for res_name, att_name in atts: attr_map[res_name].add(att_name) self._all_dep_attrs = attr_map if self._all_dep_attrs is not None: return self._all_dep_attrs[resource_name] return itertools.chain(function.dep_attrs(self._properties, resource_name), function.dep_attrs(self._metadata, resource_name))
def dep_attrs(self, resource_name, load_all=False): """Iterate over attributes of a given resource that this references. Return an iterator over dependent attributes for specified resource_name in the output's value field. """ if self._all_dep_attrs is None and load_all: attr_map = collections.defaultdict(set) for r, a in function.all_dep_attrs(self._value): attr_map[r].add(a) self._all_dep_attrs = attr_map if self._all_dep_attrs is not None: return iter(self._all_dep_attrs.get(resource_name, [])) return function.dep_attrs(self._value, resource_name)