Commit e9d622bc authored by Guido Trotter's avatar Guido Trotter
Browse files

gnt-instance: support no_PARAMETER value

Since parameters get set to False if a no_ is prefixed don't try to
interpret those boolean values, and pass them unchanged.

Reviewed-by: iustinp
parent 7a735d6a
......@@ -1182,19 +1182,21 @@ def SetInstanceParams(opts, args):
return 1
for param in opts.beparams:
if opts.beparams[param].lower() == "default":
opts.beparams[param] = constants.VALUE_DEFAULT
elif opts.beparams[param].lower() == "none":
opts.beparams[param] = constants.VALUE_NONE
elif param == constants.BE_MEMORY:
opts.beparams[constants.BE_MEMORY] = \
utils.ParseUnit(opts.beparams[constants.BE_MEMORY])
if isinstance(opts.beparams[param], basestring):
if opts.beparams[param].lower() == "default":
opts.beparams[param] = constants.VALUE_DEFAULT
elif opts.beparams[param].lower() == "none":
opts.beparams[param] = constants.VALUE_NONE
elif param == constants.BE_MEMORY:
opts.beparams[constants.BE_MEMORY] = \
utils.ParseUnit(opts.beparams[constants.BE_MEMORY])
for param in opts.hypervisor:
if opts.hypervisor[param].lower() == "default":
opts.hypervisor[param] = constants.VALUE_DEFAULT
elif opts.hypervisor[param].lower() == "none":
opts.hypervisor[param] = constants.VALUE_NONE
if isinstance(opts.hypervisor[param], basestring):
if opts.hypervisor[param].lower() == "default":
opts.hypervisor[param] = constants.VALUE_DEFAULT
elif opts.hypervisor[param].lower() == "none":
opts.hypervisor[param] = constants.VALUE_NONE
for idx, (nic_op, nic_dict) in enumerate(opts.nics):
try:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment