qvm-check: s/stdout/stderr/

This commit is contained in:
Jean-Philippe Ouellet 2016-11-28 02:53:39 -05:00
父節點 02d8f273f2
當前提交 7033f6a796
沒有發現已知的金鑰在資料庫的簽署中
GPG 金鑰 ID: E7E455013D042EA1

查看文件

@ -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()