Normalizing charm config (finally). Adding additional action upgrade config-changed test.
This commit is contained in:
parent
4263765ae8
commit
55f81f1c06
@ -48,6 +48,7 @@ def openstack_upgrade():
|
||||
try:
|
||||
do_openstack_upgrade(configs=CONFIGS)
|
||||
|
||||
# NOTE(jamespage) tell any storage-backends we just upgraded
|
||||
for rid in relation_ids('storage-backend'):
|
||||
relation_set(relation_id=rid,
|
||||
upgrade_nonce=uuid.uuid4())
|
||||
|
10
config.yaml
10
config.yaml
@ -287,8 +287,8 @@ options:
|
||||
default: False
|
||||
description: |
|
||||
If True enables openstack upgrades for this charm via juju actions.
|
||||
You will still need to set the config variable for the openstack version
|
||||
but instead of an upgrade running automatically across all units, it will
|
||||
wait for you to execute the openstack-upgrade action for this charm on each
|
||||
unit. If False it will revert to existing behavior of upgrading all units on
|
||||
config change.
|
||||
You will still need to set openstack-origin to the new repository but
|
||||
instead of an upgrade running automatically across all units, it will
|
||||
wait for you to execute the openstack-upgrade action for this charm on
|
||||
each unit. If False it will revert to existing behavior of upgrading
|
||||
all units on config change.
|
||||
|
@ -226,6 +226,16 @@ class TestChangedHooks(CharmTestCase):
|
||||
self.assertFalse(self.do_openstack_upgrade.called)
|
||||
self.assertTrue(conf_https.called)
|
||||
|
||||
@patch.object(hooks, 'git_install_requested')
|
||||
def test_config_changed_with_openstack_upgrade_action(self, git_requested):
|
||||
git_requested.return_value = False
|
||||
self.openstack_upgrade_available.return_value = True
|
||||
self.test_config.set('action-managed-upgrade', True)
|
||||
|
||||
hooks.hooks.execute(['hooks/config-changed'])
|
||||
|
||||
self.assertFalse(self.do_openstack_upgrade.called)
|
||||
|
||||
def test_db_changed(self):
|
||||
'It writes out cinder.conf on db changed'
|
||||
self.relation_get.return_value = 'cinder/0 cinder/1'
|
||||
|
Loading…
x
Reference in New Issue
Block a user