virt-install: Make bare '--wait' mean 'wait indefinitely'

This commit is contained in:
Cole Robinson 2019-06-16 22:46:39 -04:00
parent 49112dbb70
commit 230545bdb3
2 changed files with 2 additions and 1 deletions

View File

@ -844,6 +844,7 @@ c.add_compare("-c %(EXISTIMG2)s --os-variant win2k3 --vcpus cores=4 --controller
c.add_invalid("--hvm --import --wait 2", grep="exceeded specified time limit") # --wait positive number, but test suite hack
c.add_invalid("--hvm --import --wait 0", grep="exceeded specified time limit") # --wait 0, but test suite hack
c.add_invalid("--hvm --import --wait -1", grep="exceeded specified time limit") # --wait -1, but test suite hack
c.add_invalid("--hvm --import --wait", grep="exceeded specified time limit") # --wait aka --wait -1, but test suite hack
c.add_invalid("--connect test:///default --name foo --ram 64 --disk none --sdl --hvm --import", use_default_args=False, grep="exceeded specified time limit") # --sdl doesn't have a console callback, triggers implicit --wait -1
c.add_invalid("--paravirt --import --print-xml 2") # PV Import install, no second XML step
c.add_invalid("--paravirt --import --print-xml 7") # Invalid --print-xml arg

View File

@ -900,7 +900,7 @@ def parse_args():
misc.add_argument("--destroy-on-exit", action="store_true", default=False,
help=_("Force power off the domain when the console "
"viewer is closed."))
misc.add_argument("--wait", type=int,
misc.add_argument("--wait", type=int, const=-1, nargs="?",
help=_("Minutes to wait for install to complete."))
cli.add_misc_options(misc, prompt=True, printxml=True, printstep=True,