From 0411e846d1ba993042d2068fd8d4378a08f2401a Mon Sep 17 00:00:00 2001 From: Randy Barlow Date: Thu, 17 May 2018 18:26:16 +0000 Subject: [PATCH] Use a less strict string test to see if we need to run migrations. Signed-off-by: Randy Barlow --- playbooks/manual/upgrade/bodhi.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/playbooks/manual/upgrade/bodhi.yml b/playbooks/manual/upgrade/bodhi.yml index 2a4c47f259..ee72dc5797 100644 --- a/playbooks/manual/upgrade/bodhi.yml +++ b/playbooks/manual/upgrade/bodhi.yml @@ -57,9 +57,6 @@ - name: Find out what the current migration version is command: /usr/bin/python2 /usr/bin/alembic -c /etc/bodhi/alembic.ini current register: current_migration_version - - name: Find out what the latest available migration version is - command: /usr/bin/python2 /usr/bin/alembic -c /etc/bodhi/alembic.ini heads - register: latest_migration_version - name: Stop the front end if there are migrations to run hosts: os-masters[0]:os-masters-stg[0] @@ -79,7 +76,8 @@ tasks: - set_fact: - migrations: hostvars['bodhi-backend01{{ env_suffix }}.phx2.fedoraproject.org']['current_migration_version'].stdout + ' (head)' != hostvars['bodhi-backend01{{ env_suffix }}.phx2.fedoraproject.org']['latest_migration_version'].stdout + # This will be a bool that indicates whether we need to run migrations or not. + migrations: '(head)' not in hostvars['bodhi-backend01{{ env_suffix }}.phx2.fedoraproject.org']['current_migration_version'].stdout - name: Scale down to 0 pods command: oc -n bodhi scale dc/bodhi-web --replicas=0 when: migrations