Completed
Push — master ( 84e890...c23c43 )
by
unknown
22s
created

Icinga2GetStatus.run()   A

Complexity

Conditions 2

Size

Total Lines 10

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
c 0
b 0
f 0
dl 0
loc 10
rs 9.4285
1
#!/usr/bin/env python
2
from lib.icinga2action import Icinga2Action
3
import sys
4
5
6
class Icinga2GetStatus(Icinga2Action):
7
8
    def run(self):
9
        self.set_method('get')
10
        self.set_path('/status')
11
        self.logger.debug('Action Icinga2GetStatus started')
12
        client = self.get_client()
13
        client.make_call()
14
        if self.get_error() == 0:
15
            return self.get_body()
16
        else:
17
            sys.exit(self.get_error())
18