mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
Make this change python3 compatible, also provide default if generator is exhausted
This commit is contained in:
parent
44a3812bff
commit
6785eb2bef
@ -2318,7 +2318,7 @@ def get_cloud_config_value(name, vm_, opts, default=None, search_global=True):
|
|||||||
if name and vm_ and name in vm_:
|
if name and vm_ and name in vm_:
|
||||||
# The setting name exists in VM configuration.
|
# The setting name exists in VM configuration.
|
||||||
if isinstance(vm_[name], types.GeneratorType):
|
if isinstance(vm_[name], types.GeneratorType):
|
||||||
value = vm_[name].next()
|
value = next(vm_[name], '')
|
||||||
else:
|
else:
|
||||||
if isinstance(value, dict):
|
if isinstance(value, dict):
|
||||||
value.update(vm_[name].copy())
|
value.update(vm_[name].copy())
|
||||||
|
Loading…
Reference in New Issue
Block a user