Replace while with if in resolve function
Functions can't return functions, so we don't need to use `while`. This doesn't change behaviour of code, just makes it more understandable and convenient. Change-Id: Ia1dac5a9583cb99db23a8838412e5bc02e93ef4c
This commit is contained in:
parent
7ea3e68eb9
commit
ee4515ed2c
|
@ -127,8 +127,8 @@ class Function(object):
|
|||
|
||||
|
||||
def resolve(snippet):
|
||||
while isinstance(snippet, Function):
|
||||
snippet = snippet.result()
|
||||
if isinstance(snippet, Function):
|
||||
return snippet.result()
|
||||
|
||||
if isinstance(snippet, collections.Mapping):
|
||||
return dict((k, resolve(v)) for k, v in snippet.items())
|
||||
|
|
|
@ -462,9 +462,9 @@ class ResourceGroup(stack_resource.StackResource):
|
|||
# assigned. Pass in a custom resolver to the properties to not
|
||||
# error when a parameter does not have a user entered value.
|
||||
def ignore_param_resolve(snippet):
|
||||
while isinstance(snippet, function.Function):
|
||||
if isinstance(snippet, function.Function):
|
||||
try:
|
||||
snippet = snippet.result()
|
||||
return snippet.result()
|
||||
except exception.UserParameterMissing:
|
||||
return None
|
||||
|
||||
|
|
Loading…
Reference in New Issue