Completed
Pull Request — master (#412)
by Edward
01:52
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
class LibratoBaseAction(Action):
7
    def __init__(self, config):
8
        super(LibratoBaseAction, self).__init__(config)
9
        self.librato = self._get_client()
10
11
    def _get_client(self):
12
        user = self.config['user']
13
        token = self.config['token']
14
15
        client = librato.connect(user, token)
16
        return client
17