Completed
Pull Request — master (#412)
by Edward
01:52
created

LibratoBaseAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %
Metric Value
dl 0
loc 11
rs 10
wmc 2

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __init__() 0 3 1
A _get_client() 0 6 1
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