From 2b4b1e323d920811bc259bab980626c18ed98a94 Mon Sep 17 00:00:00 2001 From: Jerry Heiselman Date: Mon, 21 Dec 2020 13:12:48 -0600 Subject: [PATCH] Added logout convenience function for destorying session --- pepper/libpepper.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/pepper/libpepper.py b/pepper/libpepper.py index c9ab461..0bffb2f 100644 --- a/pepper/libpepper.py +++ b/pepper/libpepper.py @@ -448,6 +448,13 @@ def wheel(self, fun, arg=None, kwarg=None, **kwargs): def _send_auth(self, path, **kwargs): return self.req(path, kwargs) + def logout(self): + ''' + Deauthenticate the session with salt-api + ''' + self.req('/logout', {}) + self.auth = None + def login(self, username=None, password=None, eauth=None, **kwargs): ''' Authenticate with salt-api and return the user permissions and