From 73fa88cbe4abbc8eea65af9e3d1cf73133ce86ce Mon Sep 17 00:00:00 2001 From: David Ames Date: Mon, 14 Sep 2015 13:34:33 -0700 Subject: [PATCH] Action managed OpenStack upgrade --- actions/openstack-upgrade | 1 + actions/openstack_upgrade.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 120000 actions/openstack-upgrade create mode 100755 actions/openstack_upgrade.py diff --git a/actions/openstack-upgrade b/actions/openstack-upgrade new file mode 120000 index 00000000..61793013 --- /dev/null +++ b/actions/openstack-upgrade @@ -0,0 +1 @@ +openstack_upgrade.py \ No newline at end of file diff --git a/actions/openstack_upgrade.py b/actions/openstack_upgrade.py new file mode 100755 index 00000000..b327e57b --- /dev/null +++ b/actions/openstack_upgrade.py @@ -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()