Handle non-true defaults
- Support defaults that evaluate to non-true by making the conditional look for `None` specifically Change-Id: Ia912f409e29031a70beb7ec2d5e51b76843de319
This commit is contained in:
parent
0011414107
commit
111706cec6
|
@ -80,7 +80,7 @@ class Configuration:
|
||||||
if result:
|
if result:
|
||||||
return result
|
return result
|
||||||
else:
|
else:
|
||||||
if default:
|
if default is not None:
|
||||||
return default
|
return default
|
||||||
else:
|
else:
|
||||||
return jinja2.StrictUndefined(
|
return jinja2.StrictUndefined(
|
||||||
|
@ -92,7 +92,7 @@ class Configuration:
|
||||||
if result:
|
if result:
|
||||||
return result['data']
|
return result['data']
|
||||||
else:
|
else:
|
||||||
if default:
|
if default is not None:
|
||||||
return default
|
return default
|
||||||
else:
|
else:
|
||||||
return jinja2.StrictUndefined(
|
return jinja2.StrictUndefined(
|
||||||
|
|
Loading…
Reference in New Issue