749
752
return projects[key]
757
def do_action_openstack_upgrade(package, upgrade_callback, configs):
758
"""Perform action-managed OpenStack upgrade.
760
Upgrades packages to the configured openstack-origin version and sets
761
the corresponding action status as a result.
763
If the charm was installed from source we cannot upgrade it.
764
For backwards compatibility a config flag (action-managed-upgrade) must
765
be set for this code to run, otherwise a full service level upgrade will
766
fire on config-changed.
768
@param package: package name for determining if upgrade available
769
@param upgrade_callback: function callback to charm's upgrade function
770
@param configs: templating object derived from OSConfigRenderer class
772
@return: True if upgrade successful; False if upgrade failed or skipped
776
if git_install_requested():
777
action_set({'outcome': 'installed from source, skipped upgrade.'})
779
if openstack_upgrade_available(package):
780
if config('action-managed-upgrade'):
781
juju_log('Upgrading OpenStack release')
784
upgrade_callback(configs=configs)
785
action_set({'outcome': 'success, upgrade completed.'})
788
action_set({'outcome': 'upgrade failed, see traceback.'})
789
action_set({'traceback': traceback.format_exc()})
790
action_fail('do_openstack_upgrade resulted in an '
793
action_set({'outcome': 'action-managed-upgrade config is '
794
'False, skipped upgrade.'})
796
action_set({'outcome': 'no upgrade available.'})