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

VaultBaseAction   A

Complexity

Total Complexity 2

Size/Duplication

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

2 Methods

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