Support metadata for v1 reads
@@ -170,6 +170,10 @@ def hashivault_read(params):
try:
data = response.get('data', {})
data = data.get('data', {})
+ except Exception:
+ data = str(response)
+ else:
+ data = response['data']
lease_duration = response.get('lease_duration', None)
if lease_duration is not None:
result['lease_duration'] = lease_duration
@@ -179,10 +183,9 @@ def hashivault_read(params):
renewable = response.get('renewable', None)
if renewable is not None:
result['renewable'] = renewable
- except Exception:
- data = str(response)
- else:
- data = response['data']
+ wrap_info = response.get('wrap_info', None)
+ if wrap_info is not None:
+ result['wrap_info'] = wrap_info
if key and key not in data:
if default is not None:
result['value'] = default
