From e8914eabb76e1775fc7c207e7cd5ab444db93fa9 Mon Sep 17 00:00:00 2001 From: "Joshua M. Boniface" Date: Thu, 19 Nov 2020 10:26:56 -0500 Subject: [PATCH] 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. --- client-cli/pvc.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/client-cli/pvc.py b/client-cli/pvc.py index a62e49b2..57c92854 100755 --- a/client-cli/pvc.py +++ b/client-cli/pvc.py @@ -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',