Completed
Pull Request — master (#427)
by Edward
02:15
created

VaultBaseAction._get_client()   A

Complexity

Conditions 1

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %
Metric Value
cc 1
dl 0
loc 8
rs 9.4285
1
import hvac
2
from st2actions.runners.pythonrunner import Action
3
4
5
class VaultBaseAction(Action):
6
7
    def __init__(self, config):
8
        super(VaultBaseAction, self).__init__(config)
9
        self.vault = self._get_client()
10
11
    def _get_client(self):
12
        url = self.config['url']
13
        token = self.config['token']
14
        cert = self.config['cert']
15
        verify = self.config['verify']
16
17
        client = hvac.Client(url=url, token=token, cert=cert, verify=verify)
18
        return client
19