From 6a10018c8c015f29acf2682af7b3b72a5fd5a661 Mon Sep 17 00:00:00 2001 From: dosas Date: Thu, 2 Nov 2023 08:59:08 +0100 Subject: [PATCH] Check if VAULT_ADDR env var exists before deleting it (#13016) Co-authored-by: dosas (cherry picked from commit c1d7b42971f61d831e4afd635ebf0c7a27bd643a) --- robottelo/utils/vault.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/robottelo/utils/vault.py b/robottelo/utils/vault.py index d3a40d1a706..d447331ac15 100644 --- a/robottelo/utils/vault.py +++ b/robottelo/utils/vault.py @@ -31,7 +31,8 @@ def setup(self): self.export_vault_addr() def teardown(self): - del os.environ['VAULT_ADDR'] + if os.environ.get('VAULT_ADDR') is not None: + del os.environ['VAULT_ADDR'] def export_vault_addr(self): vaulturl = re.findall('VAULT_URL_FOR_DYNACONF=(.*)', self.envdata)[0]