In some cases tests fail or nuke fails and the guest is
not properly destroyed. This will look to see if it gets
an error due to the guest already existing or its disks
existing and will re-create the guest.
Signed-off-by: Sandon Van Ness <sandon@inktank.com>
(machine_name,err))
else:
log.info("%s created: %s" % (machine_name,owt))
+ #If the guest already exists first destroy then re-create:
+ if 'exists' in err:
+ log.info("Guest files exist. Re-creating guest: %s" %
+ (machine_name))
+ destroy_if_vm(ctx, machine_name)
+ create_if_vm(ctx, machine_name)
return True
#
# Use downburst to destroy a virtual machine