Deprecate authentication variable OS_TENANT_NAME
[yardstick.git] / yardstick / orchestrator / heat.py
index 1a8beae..3c3d281 100644 (file)
@@ -53,7 +53,7 @@ class HeatStack(object):
     def create(self, template, heat_parameters, wait, timeout):
         """Creates an OpenStack stack from a template"""
         with tempfile.NamedTemporaryFile('wb', delete=False) as template_file:
-            template_file.write(jsonutils.dumps(template))
+            template_file.write(jsonutils.dump_as_bytes(template))
             template_file.close()
             self._stack = self._cloud.create_stack(
                 self.name, template_file=template_file.name, wait=wait,
@@ -74,7 +74,14 @@ class HeatStack(object):
         if self.uuid is None:
             return
 
-        ret = self._cloud.delete_stack(self.uuid, wait=wait)
+        try:
+            ret = self._cloud.delete_stack(self.uuid, wait=wait)
+        except TypeError:
+            # NOTE(ralonsoh): this exception catch solves a bug in Shade, which
+            # tries to retrieve and read the stack status when it's already
+            # deleted.
+            ret = True
+
         _DEPLOYED_STACKS.pop(self.uuid)
         self._stack = None
         return ret
@@ -473,7 +480,36 @@ name (i.e. %s).
                      'port_range_max': '65535'},
                     {'remote_ip_prefix': '::/0',
                      'ethertype': 'IPv6',
-                     'protocol': 'ipv6-icmp'}
+                     'protocol': 'ipv6-icmp'},
+                    {'remote_ip_prefix': '0.0.0.0/0',
+                     'direction': 'egress',
+                     'protocol': 'tcp',
+                     'port_range_min': '1',
+                     'port_range_max': '65535'},
+                    {'remote_ip_prefix': '0.0.0.0/0',
+                     'direction': 'egress',
+                     'protocol': 'udp',
+                     'port_range_min': '1',
+                     'port_range_max': '65535'},
+                    {'remote_ip_prefix': '0.0.0.0/0',
+                     'direction': 'egress',
+                     'protocol': 'icmp'},
+                    {'remote_ip_prefix': '::/0',
+                     'direction': 'egress',
+                     'ethertype': 'IPv6',
+                     'protocol': 'tcp',
+                     'port_range_min': '1',
+                     'port_range_max': '65535'},
+                    {'remote_ip_prefix': '::/0',
+                     'direction': 'egress',
+                     'ethertype': 'IPv6',
+                     'protocol': 'udp',
+                     'port_range_min': '1',
+                     'port_range_max': '65535'},
+                    {'remote_ip_prefix': '::/0',
+                     'direction': 'egress',
+                     'ethertype': 'IPv6',
+                     'protocol': 'ipv6-icmp'},
                 ]
             }
         }