From: Frank Brehm Date: Wed, 24 Oct 2018 11:02:11 +0000 (+0200) Subject: Ensuring VM folder for VM X-Git-Tag: 0.3.2^2~31 X-Git-Url: https://git.uhu-banane.org/?a=commitdiff_plain;h=96854712340be85b2725997af834ce9d81c4cb2d;p=pixelpark%2Fcreate-vmware-tpl.git Ensuring VM folder for VM --- diff --git a/lib/cr_vmware_tpl/handler.py b/lib/cr_vmware_tpl/handler.py index 399c670..9996cc8 100644 --- a/lib/cr_vmware_tpl/handler.py +++ b/lib/cr_vmware_tpl/handler.py @@ -158,6 +158,8 @@ class CrTplHandler(BaseHandler): LOG.error("Could not find VSphere cluster {!r}.".format(self.config.vsphere_cluster)) return 6 + self.vsphere.ensure_vm_folder(self.config.folder) + return 0 @@ -181,7 +183,7 @@ class CrTplHandler(BaseHandler): try: # self.get_cluster() - self.ensure_vm_folder() +# self.ensure_vm_folder() self.check_for_temp_tpl_vm() self.select_data_store() if self.rotate_only: @@ -320,23 +322,6 @@ class CrTplHandler(BaseHandler): return None - # ------------------------------------------------------------------------- - def ensure_vm_folder(self): - - content = self.service_instance.RetrieveContent() - dc = self.get_obj(content, [vim.Datacenter], self.config.dc) - - tpl_vm_folder = self.get_tpl_folder(dc.vmFolder) - if tpl_vm_folder: - self.tpl_vm_folder = tpl_vm_folder - return True - - self._create_folder(dc.vmFolder, self.config.folder, 'VM') - - self.tpl_vm_folder = self.get_tpl_folder() - - return True - # ------------------------------------------------------------------------- def check_for_temp_tpl_vm(self): diff --git a/python_fb_tools b/python_fb_tools index 1a34235..001e121 160000 --- a/python_fb_tools +++ b/python_fb_tools @@ -1 +1 @@ -Subproject commit 1a34235b15900c1fdeb5e3550c820ccfe2c16455 +Subproject commit 001e1212e80247f144ad8291e8aec6588cfdf6fe