qvm-run: allow --localcmd with --pass-io, even when --all is given
With --localcmd, stdin/out are connected to that local process (instead of a terminal), so it doesn't conflict with --all. QubesOS/qubes-issues#1728
This commit is contained in:
parent
9fa090b422
commit
6378e2bd20
@ -129,14 +129,14 @@ def main():
|
|||||||
|
|
||||||
(options, args) = parser.parse_args ()
|
(options, args) = parser.parse_args ()
|
||||||
|
|
||||||
if options.passio and options.run_on_all_running:
|
if (options.passio and not options.localcmd) and options.run_on_all_running:
|
||||||
parser.error ("Options --all and --pass-io cannot be used together")
|
parser.error ("Options --all and --pass-io cannot be used together")
|
||||||
|
|
||||||
if options.passio:
|
if options.passio:
|
||||||
options.verbose = False
|
options.verbose = False
|
||||||
|
|
||||||
if options.color_output is None:
|
if options.color_output is None:
|
||||||
if os.isatty(sys.stdout.fileno()):
|
if os.isatty(sys.stdout.fileno()) and not options.localcmd:
|
||||||
options.color_output = 31
|
options.color_output = 31
|
||||||
elif options.color_output is False:
|
elif options.color_output is False:
|
||||||
options.color_output = None
|
options.color_output = None
|
||||||
@ -180,8 +180,6 @@ def main():
|
|||||||
continue
|
continue
|
||||||
if (options.unpause and vm.is_paused()) or (not options.unpause and vm.is_running()):
|
if (options.unpause and vm.is_paused()) or (not options.unpause and vm.is_running()):
|
||||||
vms_list.append (vm)
|
vms_list.append (vm)
|
||||||
# disable options incompatible with --all
|
|
||||||
options.passio = False
|
|
||||||
else:
|
else:
|
||||||
vm = qvm_collection.get_vm_by_name(vmname)
|
vm = qvm_collection.get_vm_by_name(vmname)
|
||||||
if vm is None:
|
if vm is None:
|
||||||
|
Loading…
Reference in New Issue
Block a user