Handle set origin

After the series upgrade a config changed hook will fire with openstack
origin or source still set to ubuntu series n-1 which will Traceback.

It is necessary to pause all primary charms which will then allow the
setting of openstack-origin or source to distro after the first unit is
in progress with the series upgrade.
This commit is contained in:
David Ames
2018-10-05 07:31:19 -07:00
parent adea4f7ebe
commit 0fba8b8568
2 changed files with 4 additions and 4 deletions

View File

@@ -50,7 +50,7 @@ class SeriesUpgradeTest(unittest.TestCase):
# Defaults
origin = "openstack-origin"
pause_non_leader_subordinate = True
pause_non_leader_primary = False
pause_non_leader_primary = True
# Skip subordinates
if applications[application]["subordinate-to"]:
continue

View File

@@ -298,6 +298,9 @@ def series_upgrade(unit_name, machine_num,
model.block_until_unit_wl_status(unit_name, "blocked")
logging.info("Watiing for model idleness")
model.block_until_all_units_idle()
logging.info("Set origin on {}".format(application))
set_origin(application, origin)
model.block_until_all_units_idle()
logging.info("Complete series upgrade on {}".format(machine_num))
model.complete_series_upgrade(machine_num)
model.block_until_all_units_idle()
@@ -305,9 +308,6 @@ def series_upgrade(unit_name, machine_num,
.format(unit_name))
model.block_until_unit_wl_status(unit_name, "active")
model.block_until_all_units_idle()
logging.info("Set origin on {}".format(application))
set_origin(application, origin)
model.block_until_all_units_idle()
# This step may be performed by juju in the future
logging.info("Set series on {} to {}".format(application, to_series))
model.set_series(application, to_series)