~1chb1n/charms/trusty/cinder/15.10-stable-flip-tests-helper-syncs

« back to all changes in this revision

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

  • Committer: James Page
  • Date: 2015-10-22 13:19:13 UTC
  • Revision ID: james.page@ubuntu.com-20151022131913-02u2l9s2fa0xtbio
Tags: 15.10
15.10 Charm release

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
 
        base_charms = ['mysql', 'mongodb']
 
47
 
 
48
        # Charms outside the lp:~openstack-charmers namespace
 
49
        base_charms = ['mysql', 'mongodb', 'nrpe']
 
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']
48
55
 
49
56
        if self.series in ['precise', 'trusty']:
50
57
            base_series = self.series
51
58
        else:
52
59
            base_series = self.current_next
53
60
 
54
 
        if self.stable:
55
 
            for svc in other_services:
 
61
        for svc in other_services:
 
62
            if svc['name'] in force_series_current:
 
63
                base_series = self.current_next
 
64
            # If a location has been explicitly set, use it
 
65
            if svc.get('location'):
 
66
                continue
 
67
            if self.stable:
56
68
                temp = 'lp:charms/{}/{}'
57
69
                svc['location'] = temp.format(base_series,
58
70
                                              svc['name'])
59
 
        else:
60
 
            for svc in other_services:
 
71
            else:
61
72
                if svc['name'] in base_charms:
62
73
                    temp = 'lp:charms/{}/{}'
63
74
                    svc['location'] = temp.format(base_series,
66
77
                    temp = 'lp:~openstack-charmers/charms/{}/{}/next'
67
78
                    svc['location'] = temp.format(self.current_next,
68
79
                                                  svc['name'])
 
80
 
69
81
        return other_services
70
82
 
71
83
    def _add_services(self, this_service, other_services):
77
89
 
78
90
        services = other_services
79
91
        services.append(this_service)
 
92
 
 
93
        # Charms which should use the source config option
80
94
        use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
81
95
                      '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']
 
96
 
 
97
        # Charms which can not use openstack-origin, ie. many subordinates
 
98
        no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe']
85
99
 
86
100
        if self.openstack:
87
101
            for svc in services:
88
 
                if svc['name'] not in use_source + ignore:
 
102
                if svc['name'] not in use_source + no_origin:
89
103
                    config = {'openstack-origin': self.openstack}
90
104
                    self.d.configure(svc['name'], config)
91
105
 
92
106
        if self.source:
93
107
            for svc in services:
94
 
                if svc['name'] in use_source and svc['name'] not in ignore:
 
108
                if svc['name'] in use_source and svc['name'] not in no_origin:
95
109
                    config = {'source': self.source}
96
110
                    self.d.configure(svc['name'], config)
97
111