From cd8ecfc8f25759192d52c610433330f70eac3ab3 Mon Sep 17 00:00:00 2001 From: Michal Nasiadka Date: Thu, 31 Oct 2024 10:50:27 +0100 Subject: [PATCH] Fix Octavia cert generation I have no clue how it worked previously in CI, but now it's using default path to the inventory - which does not exist. In addition to that, type=int in cliff will default to None, so the check had to be rewritten - because we always did cert expiry check instead of generating them. Change-Id: I84d71558c2666ba2cfa47054f782d25ff0c1f691 --- kolla_ansible/cli/commands.py | 3 ++- tests/run.yml | 2 +- tests/test-octavia.sh | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/kolla_ansible/cli/commands.py b/kolla_ansible/cli/commands.py index 9b7078ff7e..fa3b1908cc 100644 --- a/kolla_ansible/cli/commands.py +++ b/kolla_ansible/cli/commands.py @@ -201,7 +201,8 @@ class OctaviaCertificates(KollaAnsibleMixin, Command): def take_action(self, parsed_args): extra_vars = {} - if hasattr(parsed_args, "check_expiry"): + if hasattr(parsed_args, "check_expiry") \ + and parsed_args.check_expiry is not None: self.app.LOG.info("Checking if certificates expire " "within given number of days.") extra_vars["octavia_certs_check_expiry"] = "yes" diff --git a/tests/run.yml b/tests/run.yml index a93917f53b..b169800ac4 100644 --- a/tests/run.yml +++ b/tests/run.yml @@ -323,7 +323,7 @@ - name: Create TLS certificates for octavia shell: | source {{ kolla_ansible_venv_path }}/bin/activate - kolla-ansible octavia-certificates + kolla-ansible octavia-certificates -i {{ kolla_inventory_path }} -vvvv when: scenario in ['octavia'] args: executable: /bin/bash diff --git a/tests/test-octavia.sh b/tests/test-octavia.sh index 032230bbe7..d58b9592dc 100644 --- a/tests/test-octavia.sh +++ b/tests/test-octavia.sh @@ -11,7 +11,7 @@ export PYTHONUNBUFFERED=1 function check_certificate_expiry { RAW_INVENTORY=/etc/kolla/inventory source $KOLLA_ANSIBLE_VENV_PATH/bin/activate - kolla-ansible octavia-certificates --check-expiry 7 + kolla-ansible octavia-certificates -i ${RAW_INVENTORY} --check-expiry 7 deactivate }