From 9108059f71ae4dee8e97f23bb52ecc1da24bf683 Mon Sep 17 00:00:00 2001 From: Frode Nordahl Date: Thu, 7 Nov 2019 09:28:11 +0100 Subject: [PATCH] vault: Extend workaround for LP: #1826382 We also need to restart consumers of the placement API on the 'nova-cloud-controller' unit. --- zaza/openstack/charm_tests/vault/setup.py | 26 ++++++++++++++--------- 1 file changed, 16 insertions(+), 10 deletions(-) diff --git a/zaza/openstack/charm_tests/vault/setup.py b/zaza/openstack/charm_tests/vault/setup.py index 03b8f65..952bbcd 100644 --- a/zaza/openstack/charm_tests/vault/setup.py +++ b/zaza/openstack/charm_tests/vault/setup.py @@ -92,16 +92,22 @@ def auto_initialize(cacert=None, validation_application='keystone'): validate_ca(cacertificate, application=validation_application) # Once validation has completed restart nova-compute to work around # bug #1826382 - try: - cmd = 'systemctl restart nova-compute' - for unit in zaza.model.get_units('nova-compute'): - result = zaza.model.run_on_unit(unit.entity_id, cmd) - assert int(result['Code']) == 0, ( - 'Restart of nova-compute on {} failed'.format( - unit.entity_id)) - except KeyError: - # Nothing todo if there are no nova-compute units - pass + cmd_map = { + 'nova-cloud-controller': ('systemctl restart ' + 'nova-scheduler nova-conductor'), + 'nova-compute': 'systemctl restart nova-compute', + } + for app in ('nova-compute', 'nova-cloud-controller',): + try: + for unit in zaza.model.get_units(app): + result = zaza.model.run_on_unit( + unit.entity_id, cmd_map[app]) + assert int(result['Code']) == 0, ( + 'Restart of services on {} failed'.format( + unit.entity_id)) + except KeyError: + # Nothing todo if there are no app units + pass auto_initialize_no_validation = functools.partial(