Merge "Turn multiple hints with the same key into a list"
This commit is contained in:
commit
b7c51840b9
@ -97,12 +97,16 @@ def _boot(cs, args, reservation_id=None, min_count=None, max_count=None):
|
|||||||
|
|
||||||
hints = {}
|
hints = {}
|
||||||
if args.scheduler_hints:
|
if args.scheduler_hints:
|
||||||
parsed_hints = [hint.split('=', 1) for hint in args.scheduler_hints]
|
for hint in args.scheduler_hints:
|
||||||
hint_set = [dict({hint[0]: hint[1]}) for hint in parsed_hints]
|
key, _sep, value = hint.partition('=')
|
||||||
for hint in hint_set:
|
# NOTE(vish): multiple copies of the same hint will
|
||||||
hints.update(hint.items())
|
# result in a list of values
|
||||||
else:
|
if key in hints:
|
||||||
hints = {}
|
if isinstance(hints[key], basestring):
|
||||||
|
hints[key] = [hints[key]]
|
||||||
|
hints[key] += [value]
|
||||||
|
else:
|
||||||
|
hints[key] = value
|
||||||
boot_args = [args.name, image, flavor]
|
boot_args = [args.name, image, flavor]
|
||||||
|
|
||||||
if str(args.config_drive).lower() in ("true", "1"):
|
if str(args.config_drive).lower() in ("true", "1"):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user