1
from charmhelpers.contrib.amulet.deployment import (
6
class OpenStackAmuletDeployment(AmuletDeployment):
7
"""This class inherits from AmuletDeployment and has additional support
8
that is specifically for use by OpenStack charms."""
10
def __init__(self, series=None, openstack=None, source=None):
11
"""Initialize the deployment environment."""
12
super(OpenStackAmuletDeployment, self).__init__(series)
13
self.openstack = openstack
16
def _add_services(self, this_service, other_services):
17
"""Add services to the deployment and set openstack-origin."""
18
super(OpenStackAmuletDeployment, self)._add_services(this_service,
21
services = other_services
22
services.append(this_service)
23
use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph']
27
if svc[name] not in use_source:
28
config = {'openstack-origin': self.openstack}
29
self.d.configure(svc[name], config)
33
if svc[name] in use_source:
34
config = {'source': self.source}
35
self.d.configure(svc[name], config)
37
def _configure_services(self, configs):
38
"""Configure all of the services."""
39
for service, config in configs.iteritems():
40
self.d.configure(service, config)
42
def _get_openstack_release(self):
43
"""Return an integer representing the enum value of the openstack
45
self.precise_essex, self.precise_folsom, self.precise_grizzly, \
46
self.precise_havana, self.precise_icehouse, \
47
self.trusty_icehouse = range(6)
49
('precise', None): self.precise_essex,
50
('precise', 'cloud:precise-folsom'): self.precise_folsom,
51
('precise', 'cloud:precise-grizzly'): self.precise_grizzly,
52
('precise', 'cloud:precise-havana'): self.precise_havana,
53
('precise', 'cloud:precise-icehouse'): self.precise_icehouse,
54
('trusty', None): self.trusty_icehouse}
55
return releases[(self.series, self.openstack)]