Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 9D794200B55 for ; Sun, 26 Jun 2016 01:37:40 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 9C5D1160A6B; Sat, 25 Jun 2016 23:37:40 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 89E28160A75 for ; Sun, 26 Jun 2016 01:37:39 +0200 (CEST) Received: (qmail 96841 invoked by uid 500); 25 Jun 2016 23:37:38 -0000 Mailing-List: contact notifications-help@libcloud.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@libcloud.apache.org Delivered-To: mailing list notifications@libcloud.apache.org Received: (qmail 96491 invoked by uid 500); 25 Jun 2016 23:37:38 -0000 Delivered-To: apmail-libcloud-commits@libcloud.apache.org Received: (qmail 96478 invoked by uid 99); 25 Jun 2016 23:37:38 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 25 Jun 2016 23:37:38 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id D17F6E5CE1; Sat, 25 Jun 2016 23:37:37 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: anthonyshaw@apache.org To: commits@libcloud.apache.org Date: Sat, 25 Jun 2016 23:37:43 -0000 Message-Id: In-Reply-To: References: X-Mailer: ASF-Git Admin Mailer Subject: [07/14] libcloud git commit: Added forceCustomization param to ex_deploy. archived-at: Sat, 25 Jun 2016 23:37:40 -0000 Added forceCustomization param to ex_deploy. Project: http://git-wip-us.apache.org/repos/asf/libcloud/repo Commit: http://git-wip-us.apache.org/repos/asf/libcloud/commit/15b97834 Tree: http://git-wip-us.apache.org/repos/asf/libcloud/tree/15b97834 Diff: http://git-wip-us.apache.org/repos/asf/libcloud/diff/15b97834 Branch: refs/heads/trunk Commit: 15b97834d51fc077996134a5a658c006701caee1 Parents: e06c974 Author: Juan Font Alonso Authored: Thu Jun 23 18:38:31 2016 +0200 Committer: Anthony Shaw Committed: Sat Jun 25 20:00:11 2016 +1000 ---------------------------------------------------------------------- libcloud/compute/drivers/vcloud.py | 30 ++++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/libcloud/blob/15b97834/libcloud/compute/drivers/vcloud.py ---------------------------------------------------------------------- diff --git a/libcloud/compute/drivers/vcloud.py b/libcloud/compute/drivers/vcloud.py index 9789eaf..884adcf 100644 --- a/libcloud/compute/drivers/vcloud.py +++ b/libcloud/compute/drivers/vcloud.py @@ -1022,19 +1022,37 @@ class VCloud_1_5_NodeDriver(VCloudNodeDriver): else: return False - def ex_deploy_node(self, node): + def ex_deploy_node(self, node, force_customization=False): """ Deploys existing node. Equal to vApp "start" operation. :param node: The node to be deployed :type node: :class:`Node` + :param force_customization: Used to specify whether to force + customization on deployment, + if not set default value is False. + :type force_customization: ``bool`` + :rtype: :class:`Node` """ + if force_customization: + vms = self._get_vm_elements(node.id) + for vm in vms: + self._ex_deploy_node_or_vm(vm.get('href'), + force_customization=True) + else: + self._ex_deploy_node_or_vm(node.id) + + res = self.connection.request(get_url_path(node.id)) + return self._to_node(res.object) + + def _ex_deploy_node_or_vm(self, vapp_or_vm_path, force_customization=False): data = {'powerOn': 'true', + 'forceCustomization': str(force_customization).lower(), 'xmlns': 'http://www.vmware.com/vcloud/v1.5'} deploy_xml = ET.Element('DeployVAppParams', data) - path = get_url_path(node.id) + path = get_url_path(vapp_or_vm_path) headers = { 'Content-Type': 'application/vnd.vmware.vcloud.deployVAppParams+xml' @@ -1044,8 +1062,6 @@ class VCloud_1_5_NodeDriver(VCloudNodeDriver): method='POST', headers=headers) self._wait_for_task_completion(res.object.get('href')) - res = self.connection.request(get_url_path(node.id)) - return self._to_node(res.object) def ex_undeploy_node(self, node): """ @@ -1402,6 +1418,11 @@ class VCloud_1_5_NodeDriver(VCloudNodeDriver): (started) after creation :type ex_deploy: ``bool`` + :keyword ex_force_customization: Used to specify whether to force + customization on deployment, + if not set default value is False. + :type ex_force_customization: ``bool`` + :keyword ex_clone_timeout: timeout in seconds for clone/instantiate VM operation. Cloning might be a time consuming @@ -1423,6 +1444,7 @@ class VCloud_1_5_NodeDriver(VCloudNodeDriver): ex_vm_network = kwargs.get('ex_vm_network', None) ex_vm_ipmode = kwargs.get('ex_vm_ipmode', None) ex_deploy = kwargs.get('ex_deploy', True) + ex_force_customization = kwargs.get('ex_force_customization', False) ex_vdc = kwargs.get('ex_vdc', None) ex_clone_timeout = kwargs.get('ex_clone_timeout', DEFAULT_TASK_COMPLETION_TIMEOUT)