Merge pull request #522 from ajkavanagh/change-docstrings-for-vault-utils
Clean-up/correct docstrings in vault/utils.py
This commit is contained in:
@@ -140,12 +140,12 @@ def get_vip_client(cacert=None):
|
||||
def get_cluster_leader(clients):
|
||||
"""Get Vault cluster leader.
|
||||
|
||||
We have to make sure we run api calls against the actual leader.
|
||||
|
||||
:param clients: Clients list to get leader
|
||||
:type clients: List of CharmVaultClient
|
||||
:returns: CharmVaultClient
|
||||
:rtype: CharmVaultClient or None
|
||||
We have to make sure we run api calls
|
||||
against the actual leader
|
||||
"""
|
||||
if len(clients) == 1:
|
||||
return clients[0]
|
||||
@@ -159,13 +159,13 @@ def get_cluster_leader(clients):
|
||||
def get_running_config(client):
|
||||
"""Get Vault running config.
|
||||
|
||||
The hvac library does not support getting info from endpoint
|
||||
/v1/sys/config/state/sanitized Therefore we implement it here
|
||||
|
||||
:param client: Client used to get config
|
||||
:type client: CharmVaultClient
|
||||
:returns: dict from Vault api response
|
||||
:rtype: dict
|
||||
The hvac library does not support getting info
|
||||
from endpoint /v1/sys/config/state/sanitized
|
||||
Therefore we implement it here
|
||||
"""
|
||||
return requests.get(
|
||||
client.hvac_client.adapter.base_uri + '/v1/sys/config/state/sanitized',
|
||||
|
||||
Reference in New Issue
Block a user