From 57436c0ddb8668b1102f309eb684764cecbc9f80 Mon Sep 17 00:00:00 2001 From: Satellite QE <115476073+Satellite-QE@users.noreply.github.com> Date: Thu, 2 Nov 2023 18:33:01 -0400 Subject: [PATCH] [6.14.z] Check if VAULT_ADDR env var exists before deleting it (#13032) Check if VAULT_ADDR env var exists before deleting it (#13016) Co-authored-by: dosas (cherry picked from commit c1d7b42971f61d831e4afd635ebf0c7a27bd643a) Co-authored-by: dosas --- 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]