info_cache is related to deleted instance

fixes lp948586

what is now possible:
http://pastie.org/3546474

the problem was there were entities hitting the api to get network data
for instances that were deleted. Deleted instances did not have the
backref to info_cache available. The api would then go to network to get
the info, but since the network structures had already been torn down,
there was nothing to return. The bug then is that network_info at time
of instance deletion was expected to be accessible through the
instance['info_cache'].

Change-Id: I8ce6ce92e2abe6241d408192ced9526562e978db
This commit is contained in:
Trey Morris
2012-03-07 22:22:16 -06:00
parent aeea00e33e
commit 24f4e093b6

View File

@@ -297,9 +297,7 @@ class InstanceInfoCache(BASE, NovaBase):
instance = relationship(Instance, instance = relationship(Instance,
backref=backref('info_cache', uselist=False), backref=backref('info_cache', uselist=False),
foreign_keys=instance_id, foreign_keys=instance_id,
primaryjoin='and_(' primaryjoin=instance_id == Instance.uuid)
'InstanceInfoCache.instance_id == Instance.uuid,'
'InstanceInfoCache.deleted == False)')
class VirtualStorageArray(BASE, NovaBase): class VirtualStorageArray(BASE, NovaBase):