Series Upgrade

Implement the series-upgrade feature allowing to move between Ubuntu
series.

Depends-On: If42efab93dca85137d8758cae4f2e8baab75ae72
Change-Id: I0d2f2eec25c8753a4d6d0f7dffdbb54a6b35ebe1
This commit is contained in:
David Ames 2018-10-17 21:57:06 +00:00
parent a354e2efc4
commit 22399caea9
2 changed files with 8 additions and 1 deletions

View File

@ -128,6 +128,10 @@ class KeystoneLDAPCharm(charms_openstack.charm.OpenStackCharm):
if not self.configuration_complete():
hookenv.status_set('blocked',
'LDAP configuration incomplete')
elif os_utils.is_unit_upgrading_set():
hookenv.status_set('blocked',
'Ready for do-release-upgrade and reboot. '
'Set complete when finished.')
else:
hookenv.status_set('active',
'Unit is ready')

View File

@ -78,6 +78,7 @@ class TestKeystoneLDAPCharm(Helper):
'/etc/keystone/domains/keystone.userdomain.conf',
kldap_charm.configuration_file)
@mock.patch('charmhelpers.contrib.openstack.utils.is_unit_upgrading_set')
@mock.patch('charmhelpers.contrib.openstack.utils.snap_install_requested')
@mock.patch('charmhelpers.core.hookenv.config')
@mock.patch('charmhelpers.core.hookenv.status_set')
@ -85,7 +86,8 @@ class TestKeystoneLDAPCharm(Helper):
def test_assess_status(self,
application_version_set,
status_set,
config, snap_install_requested):
config, snap_install_requested,
is_unit_upgrading_set):
reply = {
'ldap-server': 'myserver',
'ldap-user': 'myusername',
@ -100,6 +102,7 @@ class TestKeystoneLDAPCharm(Helper):
config.side_effect = mock_config
snap_install_requested.return_value = False
is_unit_upgrading_set.return_value = False
with provide_charm_instance() as kldap_charm:
# Check that active status is set correctly