Completed
Pull Request — master (#552)
by
unknown
02:39
created

Icinga2GetStatus   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
c 0
b 0
f 0
dl 0
loc 12
rs 10
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A run() 0 10 2
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