~billy-olsen/charms/trusty/cinder/1468306

« back to all changes in this revision

Viewing changes to hooks/charmhelpers/contrib/openstack/amulet/deployment.py

  • Committer: billy.olsen at canonical
  • Date: 2015-09-21 23:32:41 UTC
  • mfrom: (123.1.12 cinder)
  • Revision ID: billy.olsen@canonical.com-20150921233241-texkoydwibd3vhvs
[corey.bryant,r=billy-olsen] Add action managed openstack upgrade capabilities
to cinder charm.

Show diffs side-by-side

added added

removed removed

Lines of Context:
44
44
           Determine if the local branch being tested is derived from its
45
45
           stable or next (dev) branch, and based on this, use the corresonding
46
46
           stable or next branches for the other_services."""
 
47
 
 
48
        # Charms outside the lp:~openstack-charmers namespace
47
49
        base_charms = ['mysql', 'mongodb', 'nrpe']
48
50
 
 
51
        # Force these charms to current series even when using an older series.
 
52
        # ie. Use trusty/nrpe even when series is precise, as the P charm
 
53
        # does not possess the necessary external master config and hooks.
 
54
        force_series_current = ['nrpe']
 
55
 
49
56
        if self.series in ['precise', 'trusty']:
50
57
            base_series = self.series
51
58
        else:
53
60
 
54
61
        if self.stable:
55
62
            for svc in other_services:
 
63
                if svc['name'] in force_series_current:
 
64
                    base_series = self.current_next
 
65
 
56
66
                temp = 'lp:charms/{}/{}'
57
67
                svc['location'] = temp.format(base_series,
58
68
                                              svc['name'])
59
69
        else:
60
70
            for svc in other_services:
 
71
                if svc['name'] in force_series_current:
 
72
                    base_series = self.current_next
 
73
 
61
74
                if svc['name'] in base_charms:
62
75
                    temp = 'lp:charms/{}/{}'
63
76
                    svc['location'] = temp.format(base_series,
77
90
 
78
91
        services = other_services
79
92
        services.append(this_service)
 
93
 
 
94
        # Charms which should use the source config option
80
95
        use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
81
96
                      'ceph-osd', 'ceph-radosgw']
82
 
        # Most OpenStack subordinate charms do not expose an origin option
83
 
        # as that is controlled by the principle.
84
 
        ignore = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe']
 
97
 
 
98
        # Charms which can not use openstack-origin, ie. many subordinates
 
99
        no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe']
85
100
 
86
101
        if self.openstack:
87
102
            for svc in services:
88
 
                if svc['name'] not in use_source + ignore:
 
103
                if svc['name'] not in use_source + no_origin:
89
104
                    config = {'openstack-origin': self.openstack}
90
105
                    self.d.configure(svc['name'], config)
91
106
 
92
107
        if self.source:
93
108
            for svc in services:
94
 
                if svc['name'] in use_source and svc['name'] not in ignore:
 
109
                if svc['name'] in use_source and svc['name'] not in no_origin:
95
110
                    config = {'source': self.source}
96
111
                    self.d.configure(svc['name'], config)
97
112