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

Icinga2Action   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Importance

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

10 Methods

Rating   Name   Duplication   Size   Complexity  
A get_client() 0 4 1
A set_body() 0 2 1
A get_error() 0 2 1
A get_method() 0 2 1
A set_method() 0 2 1
A get_body() 0 2 1
A run() 0 2 1
A __init__() 0 9 1
A set_path() 0 2 1
A get_path() 0 2 1
1
from st2actions.runners.pythonrunner import Action
2
from lib.client import Client
0 ignored issues
show
Bug introduced by
The name client does not seem to exist in module lib.
Loading history...
3
4
5
class Icinga2Action(Action):
6
7
    def __init__(self, config):
8
        super(Icinga2Action, self).__init__(config)
9
        self.body = ''
10
        self.error = 0
11
        self.api_url = config['api_url']
12
        self.api_user = config['api_user']
13
        self.api_password = config['api_password']
14
        self.method = 'get'
15
        self.path = ''
16
17
    def run(self):
18
        pass
19
20
    def get_client(self):
21
        client = Client(self, self.api_url + self.path, self.api_user,
22
                        self.api_password, self.method)
23
        return client
24
25
    def get_error(self):
26
        return self.error
27
28
    def get_body(self):
29
        return self.body
30
31
    def set_body(self, body):
32
        self.body = body
33
34
    def set_method(self, method):
35
        self.method = method
36
37
    def get_method(self):
38
        return self.method
39
40
    def set_path(self, path):
41
        self.path = path
42
43
    def get_path(self):
44
        return self.path
45