From bb3e1da5c7983f8ce2ec23ed468ae09cb9af1845 Mon Sep 17 00:00:00 2001 From: Daniel Wallace Date: Thu, 1 Mar 2018 09:30:20 -0700 Subject: [PATCH] Fixes #116 --- pepper/libpepper.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/pepper/libpepper.py b/pepper/libpepper.py index f0c6709..236d359 100644 --- a/pepper/libpepper.py +++ b/pepper/libpepper.py @@ -441,12 +441,21 @@ def wheel(self, fun, arg=None, kwarg=None, **kwargs): def _send_auth(self, path, **kwargs): return self.req(path, kwargs) - def login(self, **kwargs): + def login(self, username=None, password=None, eauth=None, **kwargs): ''' Authenticate with salt-api and return the user permissions and authentication token or an empty dict ''' + kwargs.update( + dict( + (key, locals()[key]) for key in ( + 'username', + 'password', + 'eauth' + ) if locals()[key] is not None + ) + ) self.auth = self._send_auth('/login', **kwargs).get('return', [{}])[0] return self.auth