Action managed openstack upgrade support
This commit is contained in:
parent
da2db93ea1
commit
aed71aaab3
|
@ -0,0 +1,4 @@
|
|||
openstack-upgrade:
|
||||
description: |
|
||||
Perform openstack upgrades. Config option action-managed-upgrade must be
|
||||
set to True.
|
|
@ -0,0 +1 @@
|
|||
openstack_upgrade.py
|
|
@ -0,0 +1,38 @@
|
|||
#!/usr/bin/python
|
||||
import sys
|
||||
import uuid
|
||||
|
||||
sys.path.append('hooks/')
|
||||
|
||||
from charmhelpers.contrib.openstack.utils import (
|
||||
do_action_openstack_upgrade,
|
||||
)
|
||||
|
||||
from ceilometer_hooks import config_changed
|
||||
|
||||
from ceilometer_utils import (
|
||||
do_openstack_upgrade,
|
||||
register_configs
|
||||
)
|
||||
|
||||
|
||||
CONFIGS = register_configs()
|
||||
|
||||
|
||||
def openstack_upgrade():
|
||||
"""Perform action-managed OpenStack upgrade.
|
||||
|
||||
Upgrades packages to the configured openstack-origin version and sets
|
||||
the corresponding action status as a result.
|
||||
|
||||
If the charm was installed from source we cannot upgrade it.
|
||||
For backwards compatibility a config flag (action-managed-upgrade) must
|
||||
be set for this code to run, otherwise a full service level upgrade will
|
||||
fire on config-changed."""
|
||||
|
||||
if (do_action_openstack_upgrade(do_openstack_upgrade,
|
||||
CONFIGS, package='ceilometer-common')):
|
||||
config_changed()
|
||||
|
||||
if __name__ == '__main__':
|
||||
openstack_upgrade()
|
10
config.yaml
10
config.yaml
|
@ -146,3 +146,13 @@ options:
|
|||
description: |
|
||||
Default multicast port number that will be used to communicate between
|
||||
HA Cluster nodes.
|
||||
action-managed-upgrade:
|
||||
type: boolean
|
||||
default: False
|
||||
description: |
|
||||
If True enables openstack upgrades for this charm via juju actions.
|
||||
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.
|
||||
|
|
|
@ -137,8 +137,9 @@ def configure_https():
|
|||
@hooks.hook('config-changed')
|
||||
@restart_on_change(restart_map())
|
||||
def config_changed():
|
||||
if openstack_upgrade_available('ceilometer-common'):
|
||||
do_openstack_upgrade(CONFIGS)
|
||||
if not config('action-managed-upgrade'):
|
||||
if openstack_upgrade_available('ceilometer-common'):
|
||||
do_openstack_upgrade(CONFIGS)
|
||||
update_nrpe_config()
|
||||
CONFIGS.write_all()
|
||||
ceilometer_joined()
|
||||
|
|
Loading…
Reference in New Issue