aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichal Nasiadka <mnasiadka@gmail.com>2024-10-31 10:50:27 +0100
committerMichal Arbet <michal.arbet@ultimum.io>2024-11-03 11:40:46 +0100
commitcd8ecfc8f25759192d52c610433330f70eac3ab3 (patch)
tree8f96c0fc3d8e4b097ac1d150fe023db7d1a6c965
parent04873199efb940552da5507eaa75262114774857 (diff)
downloadkolla-ansible-cd8ecfc8f25759192d52c610433330f70eac3ab3.tar.gz
kolla-ansible-cd8ecfc8f25759192d52c610433330f70eac3ab3.zip
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
-rw-r--r--kolla_ansible/cli/commands.py3
-rw-r--r--tests/run.yml2
-rw-r--r--tests/test-octavia.sh2
3 files changed, 4 insertions, 3 deletions
diff --git a/kolla_ansible/cli/commands.py b/kolla_ansible/cli/commands.py
index 9b7078ff7..fa3b1908c 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 a93917f53..b169800ac 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 032230bbe..d58b9592d 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
}