]> review.fuel-infra Code Review - openstack-build/heat-build.git/commitdiff
Rackspace: Parallelise CloudServer updates
authorZane Bitter <zbitter@redhat.com>
Fri, 30 Aug 2013 13:25:54 +0000 (15:25 +0200)
committerZane Bitter <zbitter@redhat.com>
Fri, 30 Aug 2013 18:51:58 +0000 (20:51 +0200)
Change-Id: I7c5f42500a3c207f0f2e9149dba092519f65a2a2

heat/engine/resources/rackspace/cloud_server.py

index d46e4eb72a0d6f1a5a7d36e6b889af888f9534d3..f4629b27ab16beba1c567f957b0404f869efa4e4 100644 (file)
@@ -403,6 +403,14 @@ zypper --non-interactive in cloud-init python-boto python-pip gcc python-devel
         Cloud Server.  If any other parameters changed, re-create the
         Cloud Server with the new parameters.
         """
+        # If name is the only update, fail update
+        if prop_diff.keys() == ['name'] and \
+           tmpl_diff.keys() == ['Properties']:
+            raise exception.NotSupported(feature="Cloud Server rename")
+        # Other updates were successful, so don't cause update to fail
+        elif 'name' in prop_diff:
+            logger.info("Cloud Server rename not supported.")
+
         if 'Metadata' in tmpl_diff:
             self.metadata = json_snippet['Metadata']
             metadata_string = json.dumps(self.metadata)
@@ -421,15 +429,8 @@ zypper --non-interactive in cloud-init python-boto python-pip gcc python-devel
             resize = scheduler.TaskRunner(nova_utils.check_resize,
                                           self.server,
                                           self.flavor)
-            resize(wait_time=1.0)
-
-        # If name is the only update, fail update
-        if prop_diff.keys() == ['name'] and \
-           tmpl_diff.keys() == ['Properties']:
-            raise exception.NotSupported(feature="Cloud Server rename")
-        # Other updates were successful, so don't cause update to fail
-        elif 'name' in prop_diff:
-            logger.info("Cloud Server rename not supported.")
+            resize.start()
+            return resize
 
     def _resolve_attribute(self, key):
         """Return the method that provides a given template attribute."""