Completed
Push — master ( 85147e...d9066e )
by Tomaz
03:35
created

MmonitSessionGet   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 11
rs 10
c 0
b 0
f 0
wmc 2
1
from lib.mmonit import MmonitBaseAction
2
3
4
class MmonitSessionGet(MmonitBaseAction):
5
    def run(self, session_key=""):
6
        self.login()
7
        data = {"key": session_key}
8
        req = self.session.post("{}/session/get".format(self.url), data=data)
9
        try:
10
            return req.json()
11
        except Exception:
12
            raise
13
        finally:
14
            self.logout()
15