Skip to content

Commit

Permalink
Merge pull request #118 from gtmanfred/develop
Browse files Browse the repository at this point in the history
Fixes #116
  • Loading branch information
gtmanfred authored Mar 1, 2018
2 parents de89d98 + bb3e1da commit d01ea8a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion pepper/libpepper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit d01ea8a

Please sign in to comment.