Skip to content

Commit

Permalink
Fix deadlock in vault writer
Browse files Browse the repository at this point in the history
  • Loading branch information
rochacbruno committed May 15, 2018
1 parent 7ec3f3c commit 83e1f80
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dynaconf/loaders/vault_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,17 @@ def get_client(obj):

def load(obj, namespace=None, silent=None, key=None):
client = get_client(obj)
data = client.read(obj.VAULT_FOR_DYNACONF_PATH).get('data', {}).get('data')
data = client.read(obj.VAULT_FOR_DYNACONF_PATH)
if data:
data = data.get('data', {}).get('data')

try:
if key:
if data and key:
value = parse_conf_data(data.get(key))
if value:
obj.set(key, value)
else:
obj.update(data, loader_identifier=IDENTIFIER)
elif data:
obj.update(data, loader_identifier=IDENTIFIER)
except Exception as e:
if silent:
if hasattr(obj, 'logger'):
Expand Down

0 comments on commit 83e1f80

Please sign in to comment.