~corey.bryant/charms/trusty/neutron-api/stuff

« back to all changes in this revision

Viewing changes to actions/openstack_upgrade.py

  • Committer: Subbarayudu Mukkamala
  • Date: 2015-10-27 14:50:30 UTC
  • mfrom: (153 neutron-api-274709)
  • mto: This revision was merged to the branch mainline in revision 155.
  • Revision ID: smukkamala@nuagenetworks.net-20151027145030-3lr5cofupf4tond8
MergeĀ fromĀ lp:~openstack-charmers/charms/trusty/.../next/

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