]> Frank Brehm's Git Trees - pixelpark/create-terraform.git/commitdiff
Fixing lib/cr_tf/handler.py
authorFrank Brehm <frank.brehm@pixelpark.com>
Mon, 25 Nov 2019 13:16:59 +0000 (14:16 +0100)
committerFrank Brehm <frank.brehm@pixelpark.com>
Mon, 25 Nov 2019 13:16:59 +0000 (14:16 +0100)
lib/cr_tf/handler.py

index b4b95dfe89a38200a56cab91b97efe88b1f46332..f5f26b1757216d443975d25ae9c0df19639a3fe3 100644 (file)
@@ -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,