~corey.bryant/charms/trusty/heat/pip

« back to all changes in this revision

Viewing changes to actions/openstack_upgrade.py

  • Committer: james.page at ubuntu
  • Date: 2015-09-24 16:19:04 UTC
  • mfrom: (53.2.7 heat)
  • Revision ID: james.page@ubuntu.com-20150924161904-zurptuwtqbq8i8a7
[coreycb,r=james-page] Add support for action managed openstack upgrades.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/usr/bin/python
 
2
import sys
 
3
 
 
4
sys.path.append('hooks/')
 
5
 
 
6
from charmhelpers.contrib.openstack.utils import (
 
7
    do_action_openstack_upgrade,
 
8
)
 
9
 
 
10
from heat_relations import (
 
11
    config_changed,
 
12
    CONFIGS,
 
13
)
 
14
 
 
15
from heat_utils import (
 
16
    do_openstack_upgrade,
 
17
)
 
18
 
 
19
 
 
20
def openstack_upgrade():
 
21
    """Perform action-managed OpenStack upgrade.
 
22
 
 
23
    Upgrades packages to the configured openstack-origin version and sets
 
24
    the corresponding action status as a result.
 
25
 
 
26
    If the charm was installed from source we cannot upgrade it.
 
27
    For backwards compatibility a config flag (action-managed-upgrade) must
 
28
    be set for this code to run, otherwise a full service level upgrade will
 
29
    fire on config-changed."""
 
30
 
 
31
    if (do_action_openstack_upgrade('heat-common',
 
32
                                    do_openstack_upgrade,
 
33
                                    CONFIGS)):
 
34
        config_changed()
 
35
 
 
36
if __name__ == '__main__':
 
37
    openstack_upgrade()