Action managed OpenStack upgrade

This commit is contained in:
David Ames 2015-09-14 13:34:33 -07:00
parent 92ebe2f094
commit 73fa88cbe4
2 changed files with 36 additions and 0 deletions

1
actions/openstack-upgrade Symbolic link
View File

@ -0,0 +1 @@
openstack_upgrade.py

35
actions/openstack_upgrade.py Executable file
View File

@ -0,0 +1,35 @@
#!/usr/bin/python
import sys
sys.path.append('hooks/')
from charmhelpers.contrib.openstack.utils import (
do_action_openstack_upgrade,
)
from neutron_utils import (
do_openstack_upgrade,
register_configs,
get_common_package,
)
CONFIGS = register_configs()
def openstack_upgrade():
"""Upgrade packages to config-set Openstack version.
If the charm was installed from source we cannot upgrade it.
For backwards compatibility a config flag must be set for this
code to run, otherwise a full service level upgrade will fire
on config-changed."""
if (do_action_openstack_upgrade(get_common_package,
do_openstack_upgrade,
CONFIGS)):
CONFIGS.write_all()
if __name__ == '__main__':
openstack_upgrade()