]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Add the Fn::GetAZs() intrinsic function.
authorAngus Salkeld <asalkeld@redhat.com>
Mon, 2 Jul 2012 03:10:59 +0000 (13:10 +1000)
committerAngus Salkeld <asalkeld@redhat.com>
Tue, 3 Jul 2012 00:03:09 +0000 (10:03 +1000)
This just returns 'nova' right now.

Change-Id: I5449123b912da0f2aaca8a16aee78d391db033dd
Signed-off-by: Angus Salkeld <asalkeld@redhat.com>
heat/engine/parser.py

index 8e77735e415c3fccc94b0996b97472e36ebc946f..2544cca41ad1a33e6eaef361e29758fa34a84665 100644 (file)
@@ -328,6 +328,19 @@ class Stack(object):
 
         return _resolve(match, handle, s)
 
+    def _resolve_availability_zones(self, s):
+        '''
+            looking for { "Fn::GetAZs" : "str" }
+        '''
+        def match(key, value):
+            return (key == 'Fn::GetAZs' and
+                    isinstance(value, basestring))
+
+        def handle(ref):
+            return ['nova']
+
+        return _resolve(match, handle, s)
+
     def _resolve_find_in_map(self, s):
         def handle(args):
             try:
@@ -380,6 +393,7 @@ class Stack(object):
 
     def resolve_static_data(self, snippet):
         return transform(snippet, [self._resolve_static_refs,
+                                   self._resolve_availability_zones,
                                    self._resolve_find_in_map])
 
     def resolve_runtime_data(self, snippet):