Browse Source

memoize creating volumes

Change-Id: I4316dee2d49b29690636e5b5b2b1a90d6011eff1
Signed-off-by: Doug Hellmann <doug@doughellmann.com>
Doug Hellmann 2 years ago
parent
commit
7b9f3bf2c6
1 changed files with 3 additions and 0 deletions
  1. 3
    0
      downpour/resolver.py

+ 3
- 0
downpour/resolver.py View File

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

Loading…
Cancel
Save