@@ -177,7 +177,7 @@ def test_01_unmanage_vm_cycle_persistent_domain(self):
177177 9. Verify details of imported VM
178178 10. Destroy VM
179179 """
180-
180+
181181 # 1 - Deploy VM
182182 self .virtual_machine = VirtualMachine .create (
183183 self .apiclient ,
@@ -187,7 +187,7 @@ def test_01_unmanage_vm_cycle_persistent_domain(self):
187187 networkids = [self .network .id , self .network1 .id , self .network2 .id ],
188188 zoneid = self .zone .id
189189 )
190-
190+
191191 vm_id = self .virtual_machine .id
192192 vm_instance_name = self .virtual_machine .instancename
193193
@@ -240,10 +240,10 @@ def test_01_unmanage_vm_cycle_persistent_domain(self):
240240 )
241241
242242 # 5 - Verify VM domain is persistent for KVM
243- ssh_host = self .get_ssh_client (host .ipaddress ,
244- self .hostConfig ["username" ],
243+ ssh_host = self .get_ssh_client (host .ipaddress ,
244+ self .hostConfig ["username" ],
245245 self .hostConfig ["password" ], 10 )
246-
246+
247247 cmd = f"virsh dominfo { vm_instance_name } "
248248 result = ssh_host .execute (cmd )
249249 if result == None or result == "" :
@@ -264,7 +264,7 @@ def test_01_unmanage_vm_cycle_persistent_domain(self):
264264 result = ssh_host .execute (cmd )
265265 if result == None or result == "" :
266266 raise Exception ("Failed to stop VM: %s on host: %s" % (vm_instance_name , host .name ))
267-
267+
268268 cmd = "virsh list --all | grep %s" % vm_instance_name
269269 result = ssh_host .execute (cmd )
270270 if result == None or result == "" :
@@ -286,8 +286,8 @@ def test_01_unmanage_vm_cycle_persistent_domain(self):
286286 if result == None or result == "" :
287287 raise Exception ("Failed to fetch VM: %s state on host: %s" % (vm_instance_name , host .name ))
288288 if 'running' not in str (result ).lower ():
289- raise Exception (f"VM: { vm_instance_name } is NOT running on host: { host .name } , state: { state_line } " )
290-
289+ raise Exception (f"VM: { vm_instance_name } is NOT running on host: { host .name } , state: { state_line } " )
290+
291291 # 8 - Import VM
292292
293293 nicnetworklist = []
@@ -333,7 +333,7 @@ def test_01_unmanage_vm_cycle_persistent_domain(self):
333333 # 10 - Destroy VM. This will be done during cleanup
334334
335335
336-
336+
337337 @attr (tags = ["advanced" , "advancedns" , "smoke" , "sg" ], required_hardware = "true" )
338338 @skipTestIf ("hypervisorNotSupported" )
339339 def test_02_unmanage_stopped_vm_cycle_persistent_domain (self ):
@@ -358,7 +358,7 @@ def test_02_unmanage_stopped_vm_cycle_persistent_domain(self):
358358 networkids = [self .network .id , self .network1 .id , self .network2 .id ],
359359 zoneid = self .zone .id
360360 )
361-
361+
362362 vm_id = self .virtual_machine .id
363363 vm_instance_name = self .virtual_machine .instancename
364364
@@ -394,7 +394,7 @@ def test_02_unmanage_stopped_vm_cycle_persistent_domain(self):
394394 vm_response .state ,
395395 "Stopped" ,
396396 "VM state should be Stopped after stopping the VM"
397- )
397+ )
398398
399399 # 3 - Unmanage VM from CloudStack
400400 self .virtual_machine .unmanage (self .apiclient )
@@ -411,16 +411,16 @@ def test_02_unmanage_stopped_vm_cycle_persistent_domain(self):
411411 )
412412
413413 # 5 - Verify VM is listed as part of the unmanaged instances
414- ssh_host = self .get_ssh_client (host .ipaddress ,
415- self .hostConfig ["username" ],
414+ ssh_host = self .get_ssh_client (host .ipaddress ,
415+ self .hostConfig ["username" ],
416416 self .hostConfig ["password" ], 10 )
417417 cmd = "virsh list --all | grep %s" % vm_instance_name
418418 result = ssh_host .execute (cmd )
419419 if result == None or result == "" :
420420 raise Exception ("Failed to fetch VM: %s state on host: %s" % (vm_instance_name , host .name ))
421421 if 'shut off' not in str (result ).lower ():
422- raise Exception (f"VM: { vm_instance_name } is NOT in stopped on host: { host .name } " )
423-
422+ raise Exception (f"VM: { vm_instance_name } is NOT in stopped on host: { host .name } " )
423+
424424 # 6 - Start VM using virsh, confirm VM is running
425425 cmd = "virsh start %s" % vm_instance_name
426426 result = ssh_host .execute (cmd )
@@ -432,8 +432,8 @@ def test_02_unmanage_stopped_vm_cycle_persistent_domain(self):
432432 if result == None or result == "" :
433433 raise Exception ("Failed to fetch VM: %s state on host: %s" % (vm_instance_name , host .name ))
434434 if 'running' not in str (result ).lower ():
435- raise Exception (f"VM: { vm_instance_name } is NOT running on host: { host .name } " )
436-
435+ raise Exception (f"VM: { vm_instance_name } is NOT running on host: { host .name } " )
436+
437437 # 8 - Import VM
438438 self .imported_vm = VirtualMachine .importUnmanagedInstance (
439439 self .apiclient ,
@@ -444,7 +444,7 @@ def test_02_unmanage_stopped_vm_cycle_persistent_domain(self):
444444 templateid = self .template .id )
445445 self .cleanup .append (self .imported_vm )
446446 self .unmanaged_instance = None
447-
447+
448448 # 9 - Verify details of the imported VM
449449 self .assertEqual (
450450 self .small_offering .id ,
0 commit comments