Better handle modifying consoles in templates

Before, the default False was problematic and would reset consoles if
the template was otherwise modified. Instead switch the flags to be full
true/false flags, and on modify, adjust the default to be None so they
will not be changed.
This commit is contained in:
Joshua Boniface 2020-11-19 10:26:56 -05:00
parent e69eb93cb3
commit e8914eabb7
1 changed files with 6 additions and 6 deletions

View File

@ -2721,14 +2721,14 @@ def provisioner_template_system_list(limit):
help='The amount of vRAM (in MB).'
)
@click.option(
'-s', '--serial', 'serial',
'-s/-S', '--serial/--no-serial', 'serial',
is_flag=True, default=False,
help='Enable the virtual serial console.'
)
@click.option(
'-n', '--vnc', 'vnc',
'-n/-N', '--vnc/--no-vnc', 'vnc',
is_flag=True, default=False,
help='Enable the VNC console.'
help='Enable/disable the VNC console.'
)
@click.option(
'-b', '--vnc-bind', 'vnc_bind',
@ -2801,14 +2801,14 @@ def provisioner_template_system_add(name, vcpus, vram, serial, vnc, vnc_bind, no
help='The amount of vRAM (in MB).'
)
@click.option(
'-s', '--serial', 'serial',
'-s/-S', '--serial/--no-serial', 'serial',
is_flag=True, default=None,
help='Enable the virtual serial console.'
)
@click.option(
'-n', '--vnc', 'vnc',
'-n/-N', '--vnc/--no-vnc', 'vnc',
is_flag=True, default=None,
help='Enable the VNC console.'
help='Enable/disable the VNC console.'
)
@click.option(
'-b', '--vnc-bind', 'vnc_bind',