26
26
Add services to the deployment where this_service is the local charm
27
27
that we're testing and other_services are the other services that
28
are being used in the amulet tests.
28
are being used in the local amulet tests.
30
name, units, location = range(3)
32
if this_service[name] != os.path.basename(os.getcwd()):
33
s = this_service[name]
30
if this_service['name'] != os.path.basename(os.getcwd()):
31
s = this_service['name']
34
32
msg = "The charm's root directory name needs to be {}".format(s)
35
33
amulet.raise_status(amulet.FAIL, msg=msg)
37
self.d.add(this_service[name], units=this_service[units])
35
if 'units' not in this_service:
36
this_service['units'] = 1
38
self.d.add(this_service['name'], units=this_service['units'])
39
40
for svc in other_services:
41
branch_location = svc[location]
42
branch_location = svc['location']
43
branch_location = 'cs:{}/{}'.format(self.series, svc[name]),
44
branch_location = 'cs:{}/{}'.format(self.series, svc['name']),
45
46
branch_location = None
46
self.d.add(svc[name], charm=branch_location, units=svc[units])
48
if 'units' not in svc:
51
self.d.add(svc['name'], charm=branch_location, units=svc['units'])
48
53
def _add_relations(self, relations):
49
54
"""Add all of the relations for the services."""