Merge "Refactor DB resource fetching from Resource to Stack"
This commit is contained in:
commit
f19af6724e
@ -121,6 +121,12 @@ class Stack(collections.Mapping):
|
||||
template_resources.items())
|
||||
return self._resources
|
||||
|
||||
def db_resource_get(self, name):
|
||||
if not self.id:
|
||||
return None
|
||||
return db_api.resource_get_by_name_and_stack(self.context,
|
||||
name, self.id)
|
||||
|
||||
@property
|
||||
def dependencies(self):
|
||||
if self._dependencies is None:
|
||||
|
@ -125,11 +125,7 @@ class Resource(object):
|
||||
|
||||
self.abandon_in_progress = False
|
||||
|
||||
if stack.id:
|
||||
resource = db_api.resource_get_by_name_and_stack(self.context,
|
||||
name, stack.id)
|
||||
else:
|
||||
resource = None
|
||||
resource = stack.db_resource_get(name)
|
||||
|
||||
if resource:
|
||||
self.resource_id = resource.nova_instance
|
||||
|
Loading…
Reference in New Issue
Block a user