memoize creating volumes

Change-Id: I4316dee2d49b29690636e5b5b2b1a90d6011eff1
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
This commit is contained in:
Doug Hellmann 2017-04-28 21:04:30 +00:00
parent 31d34c7a65
commit 7b9f3bf2c6
1 changed files with 3 additions and 0 deletions

View File

@ -101,6 +101,9 @@ class Resolver:
yield {'os_security_group_rule': rule_data}
def volume(self, volume, save_state):
if ('volume', volume.name) in self._memo:
return
self._memo.add(('volume', volume.name))
# FIXME(dhellmann): For now this only creates new empty
# volumes, and doesn't handle cases like booting from a volume
# or creating a volume from an image.