Skip to content
Snippets Groups Projects
Commit 07edf6f0 authored by MJB's avatar MJB
Browse files

new delete vm script

parent 48275d45
No related branches found
No related tags found
No related merge requests found
......@@ -36,9 +36,11 @@ for vm in lines:
proc = subprocess.Popen(['vboxmanage', 'controlvm', vm_id, 'poweroff'], stdout=subprocess.PIPE, shell=True)
out, err = proc.communicate()
print(out)
if proc.returncode != 0:
print("Error power off VM: {0}, {1}, {2}".format(vm_id, out, err))
proc = subprocess.Popen(['vboxmanage', 'unregistervm', vm_id, '--delete'], stdout=subprocess.PIPE, shell=True)
out, err = proc.communicate()
print(out)
if proc.returncode != 0:
print("Error unregister VM: {0}, {1}, {2}".format(vm_id, out, err))
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment