Merge lp:~gnuoy/charm-helpers/add-svc-params into lp:charm-helpers

Proposed by Liam Young
Status: Merged
Merged at revision: 640
Proposed branch: lp:~gnuoy/charm-helpers/add-svc-params
Merge into: lp:charm-helpers
Diff against target: 83 lines (+54/-9)
1 file modified
charmhelpers/contrib/openstack/amulet/deployment.py (+54/-9)
To merge this branch: bzr merge lp:~gnuoy/charm-helpers/add-svc-params
Reviewer Review Type Date Requested Status
James Page Approve
Review via email: mp+307153@code.launchpad.net
To post a comment you must log in.
639. By Liam Young

Add the ability to pass in the use_source and no_origin lists to stop having to raise changes to charm-helpers everytime a new service is added to an amulet test which should be added to the list

Revision history for this message
James Page (james-page) :
640. By Liam Young

Make the no_origin and use_source additive options additive to prevent the same list having to be replicated in charms

Revision history for this message
James Page (james-page) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'charmhelpers/contrib/openstack/amulet/deployment.py'
--- charmhelpers/contrib/openstack/amulet/deployment.py 2016-09-20 16:43:28 +0000
+++ charmhelpers/contrib/openstack/amulet/deployment.py 2016-09-30 09:13:10 +0000
@@ -98,8 +98,47 @@
9898
99 return other_services99 return other_services
100100
101 def _add_services(self, this_service, other_services):101 def _add_services(self, this_service, other_services, use_source=None,
102 """Add services to the deployment and set openstack-origin/source."""102 no_origin=None):
103 """Add services to the deployment and optionally set
104 openstack-origin/source.
105
106 :param this_service dict: Service dictionary describing the service
107 whose amulet tests are being run
108 :param other_services dict: List of service dictionaries describing
109 the services needed to support the target
110 service
111 :param use_source list: List of services which use the 'source' config
112 option rather than 'openstack-origin'
113 :param no_origin list: List of services which do not support setting
114 the Cloud Archive.
115 Service Dict:
116 {
117 'name': str charm-name,
118 'units': int number of units,
119 'constraints': dict of juju constraints,
120 'location': str location of charm,
121 }
122 eg
123 this_service = {
124 'name': 'openvswitch-odl',
125 'constraints': {'mem': '8G'},
126 }
127 other_services = [
128 {
129 'name': 'nova-compute',
130 'units': 2,
131 'constraints': {'mem': '4G'},
132 'location': cs:~bob/xenial/nova-compute
133 },
134 {
135 'name': 'mysql',
136 'constraints': {'mem': '2G'},
137 },
138 {'neutron-api-odl'}]
139 use_source = ['mysql']
140 no_origin = ['neutron-api-odl']
141 """
103 self.log.info('OpenStackAmuletDeployment: adding services')142 self.log.info('OpenStackAmuletDeployment: adding services')
104143
105 other_services = self._determine_branch_locations(other_services)144 other_services = self._determine_branch_locations(other_services)
@@ -110,16 +149,22 @@
110 services = other_services149 services = other_services
111 services.append(this_service)150 services.append(this_service)
112151
152 use_source = use_source or []
153 no_origin = no_origin or []
154
113 # Charms which should use the source config option155 # Charms which should use the source config option
114 use_source = ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',156 use_source = list(set(
115 'ceph-osd', 'ceph-radosgw', 'ceph-mon', 'ceph-proxy']157 use_source + ['mysql', 'mongodb', 'rabbitmq-server', 'ceph',
158 'ceph-osd', 'ceph-radosgw', 'ceph-mon',
159 'ceph-proxy']))
116160
117 # Charms which can not use openstack-origin, ie. many subordinates161 # Charms which can not use openstack-origin, ie. many subordinates
118 no_origin = ['cinder-ceph', 'hacluster', 'neutron-openvswitch', 'nrpe',162 no_origin = list(set(
119 'openvswitch-odl', 'neutron-api-odl', 'odl-controller',163 no_origin + ['cinder-ceph', 'hacluster', 'neutron-openvswitch',
120 'cinder-backup', 'nexentaedge-data',164 'nrpe', 'openvswitch-odl', 'neutron-api-odl',
121 'nexentaedge-iscsi-gw', 'nexentaedge-swift-gw',165 'odl-controller', 'cinder-backup', 'nexentaedge-data',
122 'cinder-nexentaedge', 'nexentaedge-mgmt']166 'nexentaedge-iscsi-gw', 'nexentaedge-swift-gw',
167 'cinder-nexentaedge', 'nexentaedge-mgmt']))
123168
124 if self.openstack:169 if self.openstack:
125 for svc in services:170 for svc in services:

Subscribers

People subscribed via source and target branches