Completed
Push — master ( f7c3f8...59d572 )
by Edward
04:38 queued 02:04
created

LibratoBaseAction._get_client()   A

Complexity

Conditions 1

Size

Total Lines 6

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 6
rs 9.4285
1
from st2actions.runners.pythonrunner import Action
2
3
# https://github.com/librato/python-librato
4
import librato
5
6
7
class LibratoBaseAction(Action):
8
    def __init__(self, config):
9
        super(LibratoBaseAction, self).__init__(config)
10
        self.librato = self._get_client()
11
12
    def _get_client(self):
13
        user = self.config['user']
14
        token = self.config['token']
15
16
        client = librato.connect(user, token)
17
        return client
18