1
from charmhelpers.contrib.amulet.deployment import (
6
class OpenStackAmuletDeployment(AmuletDeployment):
7
"""OpenStack amulet deployment.
9
This class inherits from AmuletDeployment and has additional support
10
that is specifically for use by OpenStack charms.
13
def __init__(self, series=None, openstack=None, source=None):
14
"""Initialize the deployment environment."""
15
super(OpenStackAmuletDeployment, self).__init__(series)
16
self.openstack = openstack
19
def _add_services(self, this_service, other_services):
20
"""Add services to the deployment and set openstack-origin."""
21
super(OpenStackAmuletDeployment, self)._add_services(this_service,
24
services = other_services
25
services.append(this_service)
26
use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph']
30
if svc[name] not in use_source:
31
config = {'openstack-origin': self.openstack}
32
self.d.configure(svc[name], config)
36
if svc[name] in use_source:
37
config = {'source': self.source}
38
self.d.configure(svc[name], config)
40
def _configure_services(self, configs):
41
"""Configure all of the services."""
42
for service, config in configs.iteritems():
43
self.d.configure(service, config)
45
def _get_openstack_release(self):
46
"""Get openstack release.
48
Return an integer representing the enum value of the openstack
51
(self.precise_essex, self.precise_folsom, self.precise_grizzly,
52
self.precise_havana, self.precise_icehouse,
53
self.trusty_icehouse) = range(6)
55
('precise', None): self.precise_essex,
56
('precise', 'cloud:precise-folsom'): self.precise_folsom,
57
('precise', 'cloud:precise-grizzly'): self.precise_grizzly,
58
('precise', 'cloud:precise-havana'): self.precise_havana,
59
('precise', 'cloud:precise-icehouse'): self.precise_icehouse,
60
('trusty', None): self.trusty_icehouse}
61
return releases[(self.series, self.openstack)]