Add a NodeData class to roll up resource data
Formalise the format for the output data from a node in the convergence graph (i.e. resource reference ID, attributes, &c.) by creating an object with an API rather than ad-hoc dicts. Change-Id: I7a705b41046bfbf81777e233e56aba24f3166510 Partially-Implements: blueprint stack-definition
This commit is contained in:
@@ -2008,18 +2008,16 @@ class Stack(collections.Mapping):
|
||||
|
||||
def has_cache_data(self, resource_name):
|
||||
return (self.cache_data is not None and
|
||||
self.cache_data.get(resource_name) is not None)
|
||||
resource_name in self.cache_data)
|
||||
|
||||
def cache_data_reference_id(self, resource_name):
|
||||
return self.cache_data.get(
|
||||
resource_name, {}).get('reference_id')
|
||||
return self.cache_data[resource_name].reference_id()
|
||||
|
||||
def cache_data_resource_attribute(self, resource_name, attribute_key):
|
||||
return self.cache_data.get(
|
||||
resource_name, {}).get('attrs', {}).get(attribute_key)
|
||||
return self.cache_data[resource_name].attribute(attribute_key)
|
||||
|
||||
def cache_data_resource_all_attributes(self, resource_name):
|
||||
return self.cache_data.get(resource_name, {}).get('attrs', {})
|
||||
return self.cache_data[resource_name].attributes()
|
||||
|
||||
def mark_complete(self):
|
||||
"""Mark the update as complete.
|
||||
|
||||
Reference in New Issue
Block a user