Merge "Support 'True' and 'False' input for system commands"
This commit is contained in:
commit
23429c4af1
|
@ -60,7 +60,7 @@ def do_show(cc, args):
|
||||||
help='The name of the system')
|
help='The name of the system')
|
||||||
@utils.arg('-s', '--sdn_enabled',
|
@utils.arg('-s', '--sdn_enabled',
|
||||||
metavar='<sdn_enabled>',
|
metavar='<sdn_enabled>',
|
||||||
choices=['true', 'false'],
|
choices=['true', 'false', 'True', 'False'],
|
||||||
help='The SDN enabled or disabled flag')
|
help='The SDN enabled or disabled flag')
|
||||||
@utils.arg('-t', '--timezone',
|
@utils.arg('-t', '--timezone',
|
||||||
metavar='<timezone>',
|
metavar='<timezone>',
|
||||||
|
@ -79,7 +79,7 @@ def do_show(cc, args):
|
||||||
help='The location of the system')
|
help='The location of the system')
|
||||||
@utils.arg('-p', '--https_enabled',
|
@utils.arg('-p', '--https_enabled',
|
||||||
metavar='<https_enabled>',
|
metavar='<https_enabled>',
|
||||||
choices=['true', 'false'],
|
choices=['true', 'false', 'True', 'False'],
|
||||||
help='The HTTPS enabled or disabled flag')
|
help='The HTTPS enabled or disabled flag')
|
||||||
@utils.arg('-v', '--vswitch_type',
|
@utils.arg('-v', '--vswitch_type',
|
||||||
metavar='<vswitch_type>',
|
metavar='<vswitch_type>',
|
||||||
|
|
|
@ -47,7 +47,7 @@ def do_network_list(cc, args):
|
||||||
help="Type of network [REQUIRED]")
|
help="Type of network [REQUIRED]")
|
||||||
@utils.arg('dynamic',
|
@utils.arg('dynamic',
|
||||||
metavar='<dynamic>',
|
metavar='<dynamic>',
|
||||||
choices=['true', 'false'],
|
choices=['true', 'false', 'True', 'False'],
|
||||||
help="dynamic [REQUIRED]")
|
help="dynamic [REQUIRED]")
|
||||||
@utils.arg('pool_uuid',
|
@utils.arg('pool_uuid',
|
||||||
metavar='<pool_uuid>',
|
metavar='<pool_uuid>',
|
||||||
|
@ -57,6 +57,10 @@ def do_network_add(cc, args):
|
||||||
|
|
||||||
field_list = ['name', 'type', 'dynamic', 'pool_uuid']
|
field_list = ['name', 'type', 'dynamic', 'pool_uuid']
|
||||||
|
|
||||||
|
# make sure dynamic is lower
|
||||||
|
if args.dynamic is not None:
|
||||||
|
args.dynamic = args.dynamic.lower()
|
||||||
|
|
||||||
# Prune input fields down to required/expected values
|
# Prune input fields down to required/expected values
|
||||||
data = dict((k, v) for (k, v) in vars(args).items()
|
data = dict((k, v) for (k, v) in vars(args).items()
|
||||||
if k in field_list and not (v is None))
|
if k in field_list and not (v is None))
|
||||||
|
|
|
@ -422,11 +422,11 @@ class SystemController(rest.RestController):
|
||||||
timezone))
|
timezone))
|
||||||
|
|
||||||
if p['path'] == '/sdn_enabled':
|
if p['path'] == '/sdn_enabled':
|
||||||
sdn_enabled = p['value']
|
sdn_enabled = p['value'].lower()
|
||||||
patch.remove(p)
|
patch.remove(p)
|
||||||
|
|
||||||
if p['path'] == '/https_enabled':
|
if p['path'] == '/https_enabled':
|
||||||
https_enabled = p['value']
|
https_enabled = p['value'].lower()
|
||||||
patch.remove(p)
|
patch.remove(p)
|
||||||
|
|
||||||
if p['path'] == '/distributed_cloud_role':
|
if p['path'] == '/distributed_cloud_role':
|
||||||
|
|
Loading…
Reference in New Issue