From: Frank Brehm Date: Mon, 25 Nov 2019 13:16:59 +0000 (+0100) Subject: Fixing lib/cr_tf/handler.py X-Git-Tag: 1.3.12~7^2~1 X-Git-Url: https://git.uhu-banane.de/?a=commitdiff_plain;h=720e46ca0022f6fcb20bb433be77707f30aed49d;p=pixelpark%2Fcreate-terraform.git Fixing lib/cr_tf/handler.py --- diff --git a/lib/cr_tf/handler.py b/lib/cr_tf/handler.py index b4b95df..f5f26b1 100644 --- a/lib/cr_tf/handler.py +++ b/lib/cr_tf/handler.py @@ -2812,11 +2812,11 @@ class CreateTerraformHandler(BaseHandler): vs_name = vm.vsphere print() - LOG.info(_("Importing VM {!r}.").format(vm['name'])) - vm_obj = 'vsphere_virtual_machine.{}'.format(vm['tf_name']) + LOG.info(_("Importing VM {!r}.").format(vm.name)) + vm_obj = 'vsphere_virtual_machine.{}'.format(vm.tf_name) path = '/{dc}/{f}/{p}/{n}'.format( dc=self.vsphere[vs_name].dc, f=self.vsphere[vs_name].dc_obj.vm_folder, - p=vm['path'], n=vm['name']) + p=vm.config_path, n=vm.name) cmd = [str(self.terraform_cmd), 'import', vm_obj, path] result = self.run( cmd, may_simulate=True, timeout=tf_timeout,