From de30b2f73df9909e6d9f8c1e9b7eccdb8ce1f544 Mon Sep 17 00:00:00 2001 From: James Page Date: Tue, 5 May 2020 15:57:04 +0100 Subject: [PATCH] Fix action managed upgrades Use the resolve_CONFIGS function to resolve the current set of CONFIGS for the charm, rather than directly referencing the CONFIGS global variable which will not be initialized during action invocation. Change-Id: Ifd084c94c9808b49dda39bafed9345bfbf6aab81 Closes-Bug: 1876585 --- actions/openstack_upgrade.py | 4 ++-- unit_tests/test_actions_openstack_upgrade.py | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/actions/openstack_upgrade.py b/actions/openstack_upgrade.py index 2da6062a..38fac62e 100755 --- a/actions/openstack_upgrade.py +++ b/actions/openstack_upgrade.py @@ -25,7 +25,7 @@ from neutron_utils import ( from neutron_hooks import ( config_changed, - CONFIGS, + resolve_CONFIGS, ) @@ -39,7 +39,7 @@ def openstack_upgrade(): if do_action_openstack_upgrade(NEUTRON_COMMON, do_openstack_upgrade, - CONFIGS): + resolve_CONFIGS()): config_changed() diff --git a/unit_tests/test_actions_openstack_upgrade.py b/unit_tests/test_actions_openstack_upgrade.py index 5919eb87..161901b9 100644 --- a/unit_tests/test_actions_openstack_upgrade.py +++ b/unit_tests/test_actions_openstack_upgrade.py @@ -14,6 +14,7 @@ TO_PATCH = [ 'config_changed', 'charmhelpers.core.hookenv.log', 'charmhelpers.contrib.openstack.utils.juju_log', + 'resolve_CONFIGS', ]