From 575c9b7b1273a672849198be4cf4c75fb17246fd Mon Sep 17 00:00:00 2001 From: Matthew Thode Date: Mon, 21 Aug 2017 16:11:12 -0500 Subject: [PATCH] Fix Newton cinder-manage check used in db-upgrades cinder-manage service list does not output a usable, full, hostname; just the short hostname is output. To fix this we need to query the database directly. We also change the behavior of this operation to drop all services. We do this at the recommendation of upstream cinder. This is safe because all cinder services are stopped and the services will re-register when restarted. Related-Bug: #1712372 Change-Id: I6d845165ec22d4c2aeece0636a550e0b57050c22 --- .../upgrade-utilities/db-migrations-newton.yml | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/leap-upgrades/upgrade-utilities/db-migrations-newton.yml b/leap-upgrades/upgrade-utilities/db-migrations-newton.yml index 80d81746..18eb43df 100644 --- a/leap-upgrades/upgrade-utilities/db-migrations-newton.yml +++ b/leap-upgrades/upgrade-utilities/db-migrations-newton.yml @@ -41,16 +41,20 @@ hosts: "cinder_all[0]" user: root tasks: + - name: Check the service list + shell: mysql -Be 'select `binary`,`host` from services;' cinder | awk '{if (NR!=1) {print $1, $2}}' + args: + executable: /bin/bash + changed_when: false + delegate_to: "{{ groups['utility_all'][0] }}" + register: cinder_service_list - name: Perform a cinder DB sync command: "{{ venv_path }}/bin/cinder-manage db sync" - name: Perform service purge - shell: | - IFS=$'\n' - for i in $({{ venv_path }}/bin/cinder-manage service list | awk '/None/ {print $1, $2}'); do - eval "{{ venv_path }}/bin/cinder-manage service remove $i" - done + shell: "{{ venv_path }}/bin/cinder-manage service remove {{ item }}" args: executable: /bin/bash + with_items: "{{ cinder_service_list.stdout_lines }}" - name: Nova DB Migrations hosts: "nova_api_os_compute[0]"