~openstack-charmers-archive/charms/trusty/neutron-gateway/trunk

« back to all changes in this revision

Viewing changes to actions/openstack_upgrade.py

  • Committer: James Page
  • Date: 2015-10-22 13:23:58 UTC
  • Revision ID: james.page@ubuntu.com-20151022132358-qin1nvlnqn4aezaz
Tags: 15.10
15.10 Charm release

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 neutron_utils import (
 
11
    do_openstack_upgrade,
 
12
    get_common_package,
 
13
)
 
14
 
 
15
from neutron_hooks import (
 
16
    config_changed,
 
17
    CONFIGS,
 
18
)
 
19
 
 
20
 
 
21
def openstack_upgrade():
 
22
    """Upgrade packages to config-set Openstack version.
 
23
 
 
24
    If the charm was installed from source we cannot upgrade it.
 
25
    For backwards compatibility a config flag must be set for this
 
26
    code to run, otherwise a full service level upgrade will fire
 
27
    on config-changed."""
 
28
 
 
29
    if do_action_openstack_upgrade(get_common_package(),
 
30
                                   do_openstack_upgrade,
 
31
                                   CONFIGS):
 
32
        config_changed()
 
33
 
 
34
 
 
35
if __name__ == '__main__':
 
36
    openstack_upgrade()