10
10
that is specifically for use by OpenStack charms.
13
def __init__(self, series=None, openstack=None, source=None):
13
def __init__(self, series=None, openstack=None, source=None, stable=True):
14
14
"""Initialize the deployment environment."""
15
15
super(OpenStackAmuletDeployment, self).__init__(series)
16
16
self.openstack = openstack
17
17
self.source = source
19
# Note(coreycb): this needs to be changed when new next branches come
21
self.current_next = "trusty"
23
def _determine_branch_locations(self, other_services):
24
"""Determine the branch locations for the other services.
26
Determine if the local branch being tested is derived from its
27
stable or next (dev) branch, and based on this, use the corresonding
28
stable or next branches for the other_services."""
29
base_charms = ['mysql', 'mongodb', 'rabbitmq-server']
32
for svc in other_services:
34
svc['location'] = temp.format(svc['name'])
36
for svc in other_services:
37
if svc['name'] in base_charms:
39
svc['location'] = temp.format(svc['name'])
41
temp = 'lp:~openstack-charmers/charms/{}/{}/next'
42
svc['location'] = temp.format(self.current_next,
19
46
def _add_services(self, this_service, other_services):
20
"""Add services to the deployment and set openstack-origin."""
47
"""Add services to the deployment and set openstack-origin/source."""
48
other_services = self._determine_branch_locations(other_services)
21
50
super(OpenStackAmuletDeployment, self)._add_services(this_service,
24
53
services = other_services
25
54
services.append(this_service)
26
use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph']
55
use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
56
'ceph-osd', 'ceph-radosgw']
29
59
for svc in services:
30
if svc[name] not in use_source:
60
if svc['name'] not in use_source:
31
61
config = {'openstack-origin': self.openstack}
32
self.d.configure(svc[name], config)
62
self.d.configure(svc['name'], config)
35
65
for svc in services:
36
if svc[name] in use_source:
66
if svc['name'] in use_source:
37
67
config = {'source': self.source}
38
self.d.configure(svc[name], config)
68
self.d.configure(svc['name'], config)
40
70
def _configure_services(self, configs):
41
71
"""Configure all of the services."""