opt_args needs to be a dict

For napalm grains, otherwise there is an exception during bootup
This commit is contained in:
Daniel Wallace 2017-08-29 16:11:40 -06:00
parent ac2189c870
commit 83b0bab34b

View file

@ -447,8 +447,8 @@ def optional_args(proxy=None):
device2:
True
'''
opt_args = _get_device_grain('optional_args', proxy=proxy)
if _FORBIDDEN_OPT_ARGS:
opt_args = _get_device_grain('optional_args', proxy=proxy) or {}
if opt_args and _FORBIDDEN_OPT_ARGS:
for arg in _FORBIDDEN_OPT_ARGS:
opt_args.pop(arg, None)
return {'optional_args': opt_args}