Compare commits
4 Commits
5b4dd61754
...
bc425b9224
Author | SHA1 | Date | |
---|---|---|---|
bc425b9224 | |||
79e5c098cd | |||
3c61a3ac03 | |||
988c777912 |
@ -169,9 +169,10 @@ def restart_opt(function):
|
|||||||
@wraps(function)
|
@wraps(function)
|
||||||
def confirm_action(*args, **kwargs):
|
def confirm_action(*args, **kwargs):
|
||||||
restart_state = kwargs.get("restart_flag", None)
|
restart_state = kwargs.get("restart_flag", None)
|
||||||
|
live_state = kwargs.get("live_flag", False)
|
||||||
|
|
||||||
if restart_state is None:
|
if restart_state is None and not live_state:
|
||||||
# Neither "--restart" or "--no-restart" was passed: prompt for restart or restart if "--unsafe"
|
# Neither "--restart" or "--no-restart" was passed, and "--no-live" was passed: prompt for restart or restart if "--unsafe"
|
||||||
try:
|
try:
|
||||||
click.confirm(
|
click.confirm(
|
||||||
f"Restart VM {kwargs.get('domain')} to apply changes",
|
f"Restart VM {kwargs.get('domain')} to apply changes",
|
||||||
@ -179,6 +180,7 @@ def restart_opt(function):
|
|||||||
abort=True,
|
abort=True,
|
||||||
)
|
)
|
||||||
kwargs["restart_flag"] = True
|
kwargs["restart_flag"] = True
|
||||||
|
kwargs["confirm_flag"] = True
|
||||||
except Exception:
|
except Exception:
|
||||||
echo(CLI_CONFIG, "Changes will be applied on next VM start/restart.")
|
echo(CLI_CONFIG, "Changes will be applied on next VM start/restart.")
|
||||||
kwargs["restart_flag"] = False
|
kwargs["restart_flag"] = False
|
||||||
|
Reference in New Issue
Block a user