Reuse ex_deploy_node when instatiating a new node.

Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo
Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/101f77f0
Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/101f77f0
Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/101f77f0

Branch: refs/heads/trunk
Commit: 101f77f06c2da6417678f9df9c0902bea5aba0fe
Parents: 951fb85
Author: Juan Font Alonso <juanfontalo...@gmail.com>
Authored: Thu Jun 23 19:08:25 2016 +0200
Committer: Juan Font Alonso <juanfontalo...@gmail.com>
Committed: Thu Jun 23 19:08:25 2016 +0200

----------------------------------------------------------------------
 libcloud/compute/drivers/vcloud.py | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/libcloud/blob/101f77f0/libcloud/compute/drivers/vcloud.py
----------------------------------------------------------------------
diff --git a/libcloud/compute/drivers/vcloud.py 
b/libcloud/compute/drivers/vcloud.py
index 884adcf..c4ba456 100644
--- a/libcloud/compute/drivers/vcloud.py
+++ b/libcloud/compute/drivers/vcloud.py
@@ -1486,15 +1486,14 @@ class VCloud_1_5_NodeDriver(VCloudNodeDriver):
 
         # Power on the VM.
         if ex_deploy:
+            res = self.connection.request(get_url_path(vapp_href))
+            node = self._to_node(res.object)
             # Retry 3 times: when instantiating large number of VMs at the same
             # time some may fail on resource allocation
             retry = 3
             while True:
                 try:
-                    res = self.connection.request(
-                        '%s/power/action/powerOn' % get_url_path(vapp_href),
-                        method='POST')
-                    self._wait_for_task_completion(res.object.get('href'))
+                    self.ex_deploy_node(node, ex_force_customization)
                     break
                 except Exception:
                     if retry <= 0:

Reply via email to