mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix #38485
This commit is contained in:
parent
aa0c843553
commit
18018139f3
1 changed files with 10 additions and 0 deletions
|
@ -81,6 +81,8 @@ try:
|
|||
except ImportError:
|
||||
HAS_NAPALM = False
|
||||
|
||||
from salt.ext import six as six
|
||||
|
||||
# ----------------------------------------------------------------------------------------------------------------------
|
||||
# proxy properties
|
||||
# ----------------------------------------------------------------------------------------------------------------------
|
||||
|
@ -281,6 +283,14 @@ def call(method, **params):
|
|||
if not NETWORK_DEVICE.get('UP', False):
|
||||
raise Exception('not connected')
|
||||
# if connected will try to execute desired command
|
||||
# but lets clean the kwargs first
|
||||
params_copy = {}
|
||||
params_copy.update(params)
|
||||
for karg, warg in six.iteritems(params_copy):
|
||||
# will remove None values
|
||||
# thus the NAPALM methods will be called with their defaults
|
||||
if warg is None:
|
||||
params.pop(karg)
|
||||
out = getattr(NETWORK_DEVICE.get('DRIVER'), method)(**params) # calls the method with the specified parameters
|
||||
result = True
|
||||
except Exception as error:
|
||||
|
|
Loading…
Add table
Reference in a new issue