From b4c5b4fc94c548b39a56113218ecbbfc3b07bbfe Mon Sep 17 00:00:00 2001 From: Mike Place Date: Wed, 28 Jan 2015 14:07:56 -0700 Subject: [PATCH] Init default args/kwargs if none are supplied in netap --- salt/netapi/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/salt/netapi/__init__.py b/salt/netapi/__init__.py index 53f626c2b3..4893ed79eb 100644 --- a/salt/netapi/__init__.py +++ b/salt/netapi/__init__.py @@ -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)