From af3c8cf29bc2acc99d73c663c51a806096f0758c Mon Sep 17 00:00:00 2001 From: Mike Crute Date: Mon, 12 Jul 2021 02:38:40 +0000 Subject: netbox: update to 2.11.9 --- netbox/django-vault-client.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'netbox/django-vault-client.py') diff --git a/netbox/django-vault-client.py b/netbox/django-vault-client.py index e699db3..85b5671 100644 --- a/netbox/django-vault-client.py +++ b/netbox/django-vault-client.py @@ -73,6 +73,10 @@ class SimpleVaultClient: url = parse.urljoin(self.base_url, parse.urljoin("/v1/", url)) req = request.Request(url, headers=headers, data=data) res = request.urlopen(req, context=context) + + if res.status != 200: + raise Exception("Failed to fetch credential from vault") + return json.load(res) def get_kv_secret(self, path, key): -- cgit v1.2.3