Init default args/kwargs if none are supplied in netap

This commit is contained in:
Mike Place 2015-01-28 14:07:56 -07:00
parent cfe10ed9d6
commit b4c5b4fc94

View File

@ -114,6 +114,10 @@ class NetapiClient(object):
:return: Returns the result from the runner module
'''
kwargs['fun'] = fun
if 'kwargs' not in kwargs:
kwargs['kwargs'] = {}
if 'args' not in kwargs:
kwargs['args'] = []
runner = salt.runner.RunnerClient(self.opts)
return runner.cmd_sync(kwargs, timeout=timeout)
@ -126,6 +130,10 @@ class NetapiClient(object):
:return: event data and a job ID for the executed function.
'''
kwargs['fun'] = fun
if 'kwargs' not in kwargs:
kwargs['kwargs'] = {}
if 'args' not in kwargs:
kwargs['args'] = []
runner = salt.runner.RunnerClient(self.opts)
return runner.cmd_async(kwargs)