From 80ba020d9cf6d47e2243a048aa12e8896b0399c5 Mon Sep 17 00:00:00 2001 From: jyejare Date: Thu, 14 Sep 2023 17:59:01 +0530 Subject: [PATCH] PR checks without vault login --- .github/workflows/pull_request.yml | 2 ++ robottelo/utils/vault.py | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index 582725d6e85..ea526c60d94 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -40,6 +40,8 @@ jobs: for conffile in conf/*.yaml.template; do mv -- "$conffile" "${conffile%.yaml.template}.yaml"; done cp broker_settings.yaml.example broker_settings.yaml cp .env.example .env + # To skip vault login in pull request checks + sed 's/^#\s*VAULT_SECRET_ID_FOR_DYNACONF=/VAULT_SECRET_ID_FOR_DYNACONF=somesecret/' .env - name: Pre Commit Checks uses: pre-commit/action@v3.0.0 diff --git a/robottelo/utils/vault.py b/robottelo/utils/vault.py index 1c5d70cb209..4ca84631f6b 100644 --- a/robottelo/utils/vault.py +++ b/robottelo/utils/vault.py @@ -61,7 +61,7 @@ def exec_vault_command(self, command: str, **kwargs): def login(self, **kwargs): if ( re.search(r'\s*#.*VAULT_SECRET_ID_FOR_DYNACONF', self.env_path.read_text()) - and 'VAULT_SECRET_ID_FOR_DYNACONF' not in os.environ + or 'VAULT_SECRET_ID_FOR_DYNACONF' not in os.environ ): if self.status(**kwargs).returncode != 0: logger.warning(