Completed
Pull Request — master (#407)
by Edward
02:14
created

ConsulBaseAction.__init__()   A

Complexity

Conditions 1

Size

Total Lines 3

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 3
rs 10
1
from st2actions.runners.pythonrunner import Action
2
3
# http://python-consul.readthedocs.org/en/latest/#
4
import consul
5
6
class ConsulBaseAction(Action):
7
8
    def __init__(self, config):
9
        super(ConsulBaseAction, self).__init__(config)
10
        self.consul = self._get_client()
11
12
    def _get_client(self):
13
        host = self.config['host']
14
        port = self.config['port']
15
        token = self.config['token']
16
17
        client = consul.Consul(host, port, token)
18
        return client
19