qvm-check: s/stdout/stderr/

This commit is contained in:
Jean-Philippe Ouellet 2016-11-28 02:53:39 -05:00
parent 02d8f273f2
commit 7033f6a796
No known key found for this signature in database
GPG Key ID: E7E455013D042EA1

View File

@ -52,30 +52,30 @@ Specify no state options to check if VM exists"""
vm = qvm_collection.get_vm_by_name(vmname)
if vm is None:
if options.verbose:
print >> sys.stdout, "A VM with the name '{0}' does not exist in the system!".format(vmname)
print >> sys.stderr, "A VM with the name '{0}' does not exist in the system!".format(vmname)
exit(1)
elif options.running:
vm_state = not vm.is_running()
if options.verbose:
print >> sys.stdout, "A VM with the name {0} is {1}running.".format(vmname, "not " * vm_state)
print >> sys.stderr, "A VM with the name {0} is {1}running.".format(vmname, "not " * vm_state)
exit(vm_state)
elif options.paused:
vm_state = not vm.is_paused()
if options.verbose:
print >> sys.stdout, "A VM with the name {0} is {1}paused.".format(vmname, "not " * vm_state)
print >> sys.stderr, "A VM with the name {0} is {1}paused.".format(vmname, "not " * vm_state)
exit(vm_state)
elif options.template:
vm_state = not vm.is_template()
if options.verbose:
print >> sys.stdout, "A VM with the name {0} is {1}a template.".format(vmname, "not " * vm_state)
print >> sys.stderr, "A VM with the name {0} is {1}a template.".format(vmname, "not " * vm_state)
exit(vm_state)
else:
if options.verbose:
print >> sys.stdout, "A VM with the name '{0}' does exist.".format(vmname)
print >> sys.stderr, "A VM with the name '{0}' does exist.".format(vmname)
exit(0)
main()