Merge lp:~plumgrid-team/charms/trusty/plumgrid-edge/trunk into lp:charms/trusty/plumgrid-edge
- Trusty Tahr (14.04)
- trunk
- Merge into trunk
Status: | Superseded | ||||
---|---|---|---|---|---|
Proposed branch: | lp:~plumgrid-team/charms/trusty/plumgrid-edge/trunk | ||||
Merge into: | lp:charms/trusty/plumgrid-edge | ||||
Diff against target: |
608 lines (+330/-62) (has conflicts) 11 files modified
Makefile (+1/-1) config.yaml (+32/-0) hooks/charmhelpers/contrib/openstack/neutron.py (+2/-2) hooks/pg_edge_context.py (+8/-7) hooks/pg_edge_hooks.py (+11/-0) hooks/pg_edge_utils.py (+131/-33) templates/kilo/ifcs.conf (+1/-1) tests/files/plumgrid-edge-dense.yaml (+133/-0) tests/tests.yaml (+2/-0) unit_tests/test_pg_edge_context.py (+8/-4) unit_tests/test_pg_edge_hooks.py (+1/-14) Conflict adding file tests/files/plumgrid-edge-dense.yaml. Moved existing file to tests/files/plumgrid-edge-dense.yaml.moved. Conflict adding file tests/tests.yaml. Moved existing file to tests/tests.yaml.moved. |
||||
To merge this branch: | bzr merge lp:~plumgrid-team/charms/trusty/plumgrid-edge/trunk | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Review Queue (community) | automated testing | Needs Fixing | |
charmers | Pending | ||
Review via email: mp+282843@code.launchpad.net |
This proposal has been superseded by a proposal from 2016-03-03.
Commit message
Description of the change
Needs sync
- 21. By Bilal Baqar
-
Merge: setting hostname of lxc to the hostname of the node
Review Queue (review-queue) wrote : | # |
Review Queue (review-queue) wrote : | # |
This item has failed automated testing! Results available here http://
- 22. By Bilal Baqar
-
Fixing lint
- 23. By Bilal Baqar
-
Made the following changes:
1. Reordered file and module imports
2. Sorted director IPs
3. Added unit fqdn in /etc/hosts of plumgrid-lxc
4. Loading plumgrid specific iptables on install
5. Added temporary upgrade hook to load iptables
6. stop_pg() is being used in restart_pg()
7. persistant iptables - 24. By Bilal Baqar
-
Improved config-changed hook to perform steps according to the config changed
- 25. By Bilal Baqar
-
OPSVM Changes - Ticket: [SOL-830]
- Getting OPSVM IP from director relation
- Making OPSVM specific changes
- Cleaned code in various functions
- Added restart_on_change decorater function that restarts plumgrid service only when there has been any change in the configuration files
- Removed restart of plumgrid service when only two directors are available
- Fixed unit tests accordingly - 26. By Bilal Baqar
-
Adding status messages in charms - Ticket:[SOL-949]
- 27. By Bilal Baqar
-
Merge: Liberty/Mitaka support
- 28. By Bilal Baqar
-
Merge - Charmhelpers sync and improved pg-restart
- 29. By Bilal Baqar
-
5.1 changes
- configure-pg-sources added
- updated templates - 30. By Junaid Ali
-
L3 fabric changes
- 31. By Junaid Ali
-
Changes:
- Default value for management interface removed as
'juju-br0' has been changed to 'br-eth0' in Juju 2.0
- Updated get_mgmt_interface method
Unmerged revisions
- 31. By Junaid Ali
-
Changes:
- Default value for management interface removed as
'juju-br0' has been changed to 'br-eth0' in Juju 2.0
- Updated get_mgmt_interface method
Preview Diff
1 | === modified file 'Makefile' |
2 | --- Makefile 2015-08-24 16:22:15 +0000 |
3 | +++ Makefile 2016-03-03 21:45:16 +0000 |
4 | @@ -7,7 +7,7 @@ |
5 | netaddr jinja2 |
6 | |
7 | lint: virtualenv |
8 | - .venv/bin/flake8 --exclude hooks/charmhelpers hooks unit_tests tests |
9 | + .venv/bin/flake8 --exclude hooks/charmhelpers hooks unit_tests tests --ignore E402 |
10 | @charm proof |
11 | |
12 | unit_test: virtualenv |
13 | |
14 | === modified file 'config.yaml' |
15 | --- config.yaml 2015-08-09 15:48:20 +0000 |
16 | +++ config.yaml 2016-03-03 21:45:16 +0000 |
17 | @@ -3,6 +3,28 @@ |
18 | default: 'null' |
19 | type: string |
20 | description: Public SSH key of PLUMgrid LCM which is running PG-Tools |
21 | + mgmt-interface: |
22 | + type: string |
23 | + default: 'juju-br0' |
24 | + description: The interface connected to PLUMgrid Managment network. |
25 | + os-data-network: |
26 | + type: string |
27 | + default: |
28 | + description: | |
29 | + The IP address and netmask of the OpenStack Data network (e.g., |
30 | + 192.168.0.0/24) |
31 | + . |
32 | + This network will be used for tenant network traffic in overlay |
33 | + networks. |
34 | + fabric-interfaces: |
35 | + default: 'MANAGEMENT' |
36 | + type: string |
37 | + description: | |
38 | + Interfaces that will provide fabric connectivity on the director nodes. |
39 | + Provided in form of json in a string. These interfaces have to be connected |
40 | + to the os-data-network specified in the config. Default value is MANAGEMENT which |
41 | + will configure the management interface as the fabric interface on each |
42 | + director. |
43 | network-device-mtu: |
44 | type: string |
45 | default: '1580' |
46 | @@ -15,6 +37,16 @@ |
47 | default: null |
48 | type: string |
49 | description: Provide the respective keys of the install sources |
50 | + plumgrid-build: |
51 | + default: 'latest' |
52 | + type: string |
53 | + description: | |
54 | + Provide the build version of PLUMgrid packages that needs to be installed |
55 | + iovisor-build: |
56 | + default: 'latest' |
57 | + type: string |
58 | + description: | |
59 | + Provide the build version of iovisor package that needs to be installed |
60 | metadata-shared-key: |
61 | default: 'plumgrid' |
62 | type: string |
63 | |
64 | === modified file 'hooks/charmhelpers/contrib/openstack/neutron.py' |
65 | --- hooks/charmhelpers/contrib/openstack/neutron.py 2015-07-29 18:19:18 +0000 |
66 | +++ hooks/charmhelpers/contrib/openstack/neutron.py 2016-03-03 21:45:16 +0000 |
67 | @@ -204,8 +204,8 @@ |
68 | database=config('database'), |
69 | ssl_dir=NEUTRON_CONF_DIR)], |
70 | 'services': [], |
71 | - 'packages': [['plumgrid-lxc'], |
72 | - ['iovisor-dkms']], |
73 | + 'packages': ['plumgrid-lxc', |
74 | + 'iovisor-dkms'], |
75 | 'server_packages': ['neutron-server', |
76 | 'neutron-plugin-plumgrid'], |
77 | 'server_services': ['neutron-server'] |
78 | |
79 | === modified file 'hooks/pg_edge_context.py' |
80 | --- hooks/pg_edge_context.py 2015-08-24 16:22:15 +0000 |
81 | +++ hooks/pg_edge_context.py 2016-03-03 21:45:16 +0000 |
82 | @@ -9,7 +9,7 @@ |
83 | relation_get, |
84 | ) |
85 | from charmhelpers.contrib.openstack import context |
86 | - |
87 | +from charmhelpers.contrib.openstack.utils import get_host_ip |
88 | from socket import gethostname as get_unit_hostname |
89 | |
90 | |
91 | @@ -21,7 +21,7 @@ |
92 | for rid in relation_ids('plumgrid'): |
93 | for unit in related_units(rid): |
94 | rdata = relation_get(rid=rid, unit=unit) |
95 | - director_ips.append(str(rdata['private-address'])) |
96 | + director_ips.append(str(get_host_ip(rdata['private-address']))) |
97 | return director_ips |
98 | |
99 | |
100 | @@ -69,11 +69,12 @@ |
101 | else: |
102 | pg_dir_ips = pg_dir_ips + ',' + str(ip) |
103 | pg_ctxt['local_ip'] = pg_dir_ips |
104 | - pg_ctxt['pg_hostname'] = "pg-edge" |
105 | - from pg_edge_utils import check_interface_type |
106 | - interface_type = check_interface_type() |
107 | - pg_ctxt['interface'] = interface_type |
108 | - pg_ctxt['label'] = get_unit_hostname() |
109 | + unit_hostname = get_unit_hostname() |
110 | + pg_ctxt['pg_hostname'] = unit_hostname |
111 | + from pg_edge_utils import get_mgmt_interface, get_fabric_interface |
112 | + pg_ctxt['interface'] = get_mgmt_interface() |
113 | + pg_ctxt['fabric_interface'] = get_fabric_interface() |
114 | + pg_ctxt['label'] = unit_hostname |
115 | pg_ctxt['fabric_mode'] = 'host' |
116 | |
117 | return pg_ctxt |
118 | |
119 | === modified file 'hooks/pg_edge_hooks.py' |
120 | --- hooks/pg_edge_hooks.py 2015-08-16 19:07:22 +0000 |
121 | +++ hooks/pg_edge_hooks.py 2016-03-03 21:45:16 +0000 |
122 | @@ -32,6 +32,7 @@ |
123 | remove_iovisor, |
124 | ensure_mtu, |
125 | add_lcm_key, |
126 | + fabric_interface_changed |
127 | ) |
128 | |
129 | hooks = Hooks() |
130 | @@ -89,11 +90,21 @@ |
131 | if add_lcm_key(): |
132 | log("PLUMgrid LCM Key added") |
133 | return 1 |
134 | + charm_config = config() |
135 | + if charm_config.changed('fabric-interfaces'): |
136 | + if not fabric_interface_changed(): |
137 | + log("Fabric interface already set") |
138 | + return 1 |
139 | + if charm_config.changed('os-data-network'): |
140 | + if charm_config['fabric-interfaces'] == 'MANAGEMENT': |
141 | + log('Fabric running on managment network') |
142 | + return 1 |
143 | stop_pg() |
144 | configure_sources(update=True) |
145 | pkgs = determine_packages() |
146 | for pkg in pkgs: |
147 | apt_install(pkg, options=['--force-yes'], fatal=True) |
148 | + remove_iovisor() |
149 | load_iovisor() |
150 | ensure_mtu() |
151 | for rid in relation_ids('neutron-plugin'): |
152 | |
153 | === modified file 'hooks/pg_edge_utils.py' |
154 | --- hooks/pg_edge_utils.py 2015-11-12 11:55:13 +0000 |
155 | +++ hooks/pg_edge_utils.py 2016-03-03 21:45:16 +0000 |
156 | @@ -7,6 +7,14 @@ |
157 | from charmhelpers.core.hookenv import ( |
158 | log, |
159 | config, |
160 | + unit_get |
161 | +) |
162 | +from charmhelpers.contrib.network.ip import ( |
163 | + get_iface_from_addr, |
164 | + get_bridges, |
165 | + get_bridge_nics, |
166 | + is_address_in_network, |
167 | + get_iface_addr |
168 | ) |
169 | from charmhelpers.core.host import ( |
170 | write_file, |
171 | @@ -14,6 +22,9 @@ |
172 | service_start, |
173 | service_stop, |
174 | ) |
175 | +from charmhelpers.fetch import ( |
176 | + apt_cache |
177 | +) |
178 | from charmhelpers.contrib.storage.linux.ceph import modprobe |
179 | from charmhelpers.core.host import set_nic_mtu |
180 | from charmhelpers.fetch import apt_install |
181 | @@ -22,11 +33,12 @@ |
182 | from charmhelpers.contrib.openstack.utils import ( |
183 | os_release, |
184 | ) |
185 | +from socket import gethostname as get_unit_hostname |
186 | import pg_edge_context |
187 | import subprocess |
188 | import time |
189 | import os |
190 | -import re |
191 | +import json |
192 | |
193 | SHARED_SECRET = "/etc/nova/secret.txt" |
194 | LXC_CONF = '/etc/libvirt/lxc.conf' |
195 | @@ -72,7 +84,25 @@ |
196 | Returns list of packages required by PLUMgrid Edge as specified |
197 | in the neutron_plugins dictionary in charmhelpers. |
198 | ''' |
199 | - return neutron_plugin_attribute('plumgrid', 'packages', 'neutron') |
200 | + pkgs = [] |
201 | + tag = 'latest' |
202 | + for pkg in neutron_plugin_attribute('plumgrid', 'packages', 'neutron'): |
203 | + if 'plumgrid' in pkg: |
204 | + tag = config('plumgrid-build') |
205 | + elif pkg == 'iovisor-dkms': |
206 | + tag = config('iovisor-build') |
207 | + |
208 | + if tag == 'latest': |
209 | + pkgs.append(pkg) |
210 | + else: |
211 | + if tag in [i.ver_str for i in apt_cache()[pkg].version_list]: |
212 | + pkgs.append('%s=%s' % (pkg, tag)) |
213 | + else: |
214 | + error_msg = \ |
215 | + "Build version '%s' for package '%s' not available" \ |
216 | + % (tag, pkg) |
217 | + raise ValueError(error_msg) |
218 | + return pkgs |
219 | |
220 | |
221 | def register_configs(release=None): |
222 | @@ -81,6 +111,9 @@ |
223 | the context required for all templates of this charm. |
224 | ''' |
225 | release = release or os_release('nova-compute', base='kilo') |
226 | + if release < 'kilo': |
227 | + raise ValueError('OpenStack %s release not supported' % release) |
228 | + |
229 | configs = templating.OSConfigRenderer(templates_dir=TEMPLATES, |
230 | openstack_release=release) |
231 | for cfg, rscs in resource_map().iteritems(): |
232 | @@ -151,52 +184,116 @@ |
233 | ''' |
234 | _exec_cmd(cmd=['rmmod', 'iovisor'], |
235 | error_msg='Error Loading Iovisor Kernel Module') |
236 | - |
237 | - |
238 | -def check_interface_type(): |
239 | - ''' |
240 | - Checks the interface. Support added for AWS deployments. There are 2 |
241 | - possible interfaces "juju-br0" and "eth0". The default being juju-br0 |
242 | - ''' |
243 | - log("Checking Interface Type") |
244 | - default_interface = "juju-br0" |
245 | - AWS_interface = "eth0" |
246 | - shell_output = subprocess.check_output(['brctl', 'show', 'juju-br0']) |
247 | - output = re.split(' |\n|\t', shell_output) |
248 | - if output[10] == '': |
249 | - return AWS_interface |
250 | - else: |
251 | - return default_interface |
252 | + time.sleep(1) |
253 | + |
254 | + |
255 | +def interface_exists(interface): |
256 | + ''' |
257 | + Checks if interface exists on node. |
258 | + ''' |
259 | + try: |
260 | + subprocess.check_call(['ip', 'link', 'show', interface], |
261 | + stdout=open(os.devnull, 'w'), |
262 | + stderr=subprocess.STDOUT) |
263 | + except subprocess.CalledProcessError: |
264 | + return False |
265 | + return True |
266 | + |
267 | + |
268 | +def get_mgmt_interface(): |
269 | + ''' |
270 | + Returns the managment interface. |
271 | + ''' |
272 | + mgmt_interface = config('mgmt-interface') |
273 | + if interface_exists(mgmt_interface): |
274 | + return mgmt_interface |
275 | + else: |
276 | + log('Provided managment interface %s does not exist' |
277 | + % mgmt_interface) |
278 | + return get_iface_from_addr(unit_get('private-address')) |
279 | + |
280 | + |
281 | +def fabric_interface_changed(): |
282 | + ''' |
283 | + Returns true if interface for node changed. |
284 | + ''' |
285 | + fabric_interface = get_fabric_interface() |
286 | + try: |
287 | + with open(PG_IFCS_CONF, 'r') as ifcs: |
288 | + for line in ifcs: |
289 | + if 'fabric_core' in line: |
290 | + if line.split()[0] == fabric_interface: |
291 | + return False |
292 | + except IOError: |
293 | + return True |
294 | + return True |
295 | + |
296 | + |
297 | +def get_fabric_interface(): |
298 | + ''' |
299 | + Returns the fabric interface. |
300 | + ''' |
301 | + fabric_interfaces = config('fabric-interfaces') |
302 | + if fabric_interfaces == 'MANAGEMENT': |
303 | + return get_mgmt_interface() |
304 | + else: |
305 | + try: |
306 | + all_fabric_interfaces = json.loads(fabric_interfaces) |
307 | + except ValueError: |
308 | + raise ValueError('Invalid json provided for fabric interfaces') |
309 | + hostname = get_unit_hostname() |
310 | + if hostname in all_fabric_interfaces: |
311 | + node_fabric_interface = all_fabric_interfaces[hostname] |
312 | + elif 'DEFAULT' in all_fabric_interfaces: |
313 | + node_fabric_interface = all_fabric_interfaces['DEFAULT'] |
314 | + else: |
315 | + raise ValueError('No fabric interface provided for node') |
316 | + if interface_exists(node_fabric_interface): |
317 | + if is_address_in_network(config('os-data-network'), |
318 | + get_iface_addr(node_fabric_interface)[0]): |
319 | + return node_fabric_interface |
320 | + else: |
321 | + raise ValueError('Fabric interface not in fabric network') |
322 | + else: |
323 | + log('Provided fabric interface %s does not exist' |
324 | + % node_fabric_interface) |
325 | + raise ValueError('Provided fabric interface does not exist') |
326 | + return node_fabric_interface |
327 | |
328 | |
329 | def ensure_mtu(): |
330 | ''' |
331 | Ensures required MTU of the underlying networking of the node. |
332 | ''' |
333 | - log("Changing MTU of juju-br0 and all attached interfaces") |
334 | interface_mtu = config('network-device-mtu') |
335 | - interface_type = check_interface_type() |
336 | - if interface_type == "juju-br0": |
337 | - cmd = subprocess.check_output(["brctl", "show", interface_type]) |
338 | - words = cmd.split() |
339 | - for word in words: |
340 | - if 'eth' in word: |
341 | - set_nic_mtu(word, interface_mtu) |
342 | - set_nic_mtu(interface_type, interface_mtu) |
343 | - |
344 | - |
345 | -def _exec_cmd(cmd=None, error_msg='Command exited with ERRORs', fatal=False): |
346 | + fabric_interface = get_fabric_interface() |
347 | + if fabric_interface in get_bridges(): |
348 | + attached_interfaces = get_bridge_nics(fabric_interface) |
349 | + for interface in attached_interfaces: |
350 | + set_nic_mtu(interface, interface_mtu) |
351 | + set_nic_mtu(fabric_interface, interface_mtu) |
352 | + |
353 | + |
354 | +def _exec_cmd(cmd=None, error_msg='Command exited with ERRORs', fatal=False, |
355 | + verbose=False): |
356 | ''' |
357 | Function to execute any bash command on the node. |
358 | ''' |
359 | if cmd is None: |
360 | log("No command specified") |
361 | else: |
362 | - if fatal: |
363 | + if fatal and verbose: |
364 | + subprocess.check_call(cmd, stdout=open(os.devnull, 'w'), |
365 | + stderr=subprocess.STDOUT) |
366 | + elif fatal and not verbose: |
367 | subprocess.check_call(cmd) |
368 | else: |
369 | try: |
370 | - subprocess.check_call(cmd) |
371 | + if verbose: |
372 | + subprocess.check_call(cmd, stdout=open(os.devnull, 'w'), |
373 | + stderr=subprocess.STDOUT) |
374 | + else: |
375 | + subprocess.check_call(cmd) |
376 | except subprocess.CalledProcessError: |
377 | log(error_msg) |
378 | |
379 | @@ -208,7 +305,8 @@ |
380 | apt_install('apparmor-utils') |
381 | apt_install('cgroup-bin') |
382 | _exec_cmd(['sudo', 'aa-disable', '/usr/sbin/libvirtd'], |
383 | - error_msg='Error disabling AppArmor profile of libvirtd') |
384 | + error_msg='Error disabling AppArmor profile of libvirtd', |
385 | + verbose=True) |
386 | disable_apparmor() |
387 | service_restart('libvirt-bin') |
388 | |
389 | |
390 | === modified file 'templates/kilo/ifcs.conf' |
391 | --- templates/kilo/ifcs.conf 2015-07-29 18:19:18 +0000 |
392 | +++ templates/kilo/ifcs.conf 2016-03-03 21:45:16 +0000 |
393 | @@ -1,2 +1,2 @@ |
394 | -{{ interface }} = fabric_core host |
395 | +{{ fabric_interface }} = fabric_core host |
396 | |
397 | |
398 | === added file 'tests/files/plumgrid-edge-dense.yaml' |
399 | --- tests/files/plumgrid-edge-dense.yaml 1970-01-01 00:00:00 +0000 |
400 | +++ tests/files/plumgrid-edge-dense.yaml 2016-03-03 21:45:16 +0000 |
401 | @@ -0,0 +1,133 @@ |
402 | +test: |
403 | + series: 'trusty' |
404 | + relations: |
405 | + - - mysql |
406 | + - keystone |
407 | + - - nova-cloud-controller |
408 | + - mysql |
409 | + - - nova-cloud-controller |
410 | + - rabbitmq-server |
411 | + - - nova-cloud-controller |
412 | + - glance |
413 | + - - nova-cloud-controller |
414 | + - keystone |
415 | + - - nova-compute |
416 | + - nova-cloud-controller |
417 | + - - nova-compute |
418 | + - mysql |
419 | + - - nova-compute |
420 | + - rabbitmq-server |
421 | + - - nova-compute |
422 | + - glance |
423 | + - - glance |
424 | + - mysql |
425 | + - - glance |
426 | + - keystone |
427 | + - - glance |
428 | + - cinder |
429 | + - - mysql |
430 | + - cinder |
431 | + - - cinder |
432 | + - rabbitmq-server |
433 | + - - cinder |
434 | + - nova-cloud-controller |
435 | + - - cinder |
436 | + - keystone |
437 | + - - openstack-dashboard |
438 | + - keystone |
439 | + - - neutron-api |
440 | + - mysql |
441 | + - - neutron-api |
442 | + - keystone |
443 | + - - neutron-api |
444 | + - rabbitmq-server |
445 | + - - neutron-api |
446 | + - nova-cloud-controller |
447 | + - - neutron-api |
448 | + - neutron-api-plumgrid |
449 | + - - neutron-api-plumgrid |
450 | + - plumgrid-edge |
451 | + - - plumgrid-director |
452 | + - plumgrid-edge |
453 | + - - nova-compute |
454 | + - plumgrid-edge |
455 | + - - plumgrid-director |
456 | + - plumgrid-gateway |
457 | + services: |
458 | + mysql: |
459 | + charm: cs:trusty/mysql |
460 | + num_units: 1 |
461 | + to: 'lxc:plumgrid-director=0' |
462 | + rabbitmq-server: |
463 | + charm: cs:trusty/rabbitmq-server |
464 | + num_units: 1 |
465 | + to: 'lxc:plumgrid-director=0' |
466 | + keystone: |
467 | + charm: cs:trusty/keystone |
468 | + num_units: 1 |
469 | + options: |
470 | + admin-password: plumgrid |
471 | + openstack-origin: cloud:trusty-kilo |
472 | + to: 'lxc:plumgrid-director=0' |
473 | + nova-cloud-controller: |
474 | + charm: cs:trusty/nova-cloud-controller |
475 | + num_units: 1 |
476 | + options: |
477 | + console-access-protocol: novnc |
478 | + network-manager: Neutron |
479 | + openstack-origin: cloud:trusty-kilo |
480 | + quantum-security-groups: 'yes' |
481 | + to: 'lxc:plumgrid-director=0' |
482 | + glance: |
483 | + charm: cs:trusty/glance |
484 | + num_units: 1 |
485 | + options: |
486 | + openstack-origin: cloud:trusty-kilo |
487 | + to: 'lxc:plumgrid-director=0' |
488 | + openstack-dashboard: |
489 | + charm: cs:trusty/openstack-dashboard |
490 | + num_units: 1 |
491 | + options: |
492 | + openstack-origin: cloud:trusty-kilo |
493 | + to: 'lxc:plumgrid-director=0' |
494 | + cinder: |
495 | + charm: cs:trusty/cinder |
496 | + num_units: 1 |
497 | + options: |
498 | + openstack-origin: cloud:trusty-kilo |
499 | + to: 'lxc:plumgrid-director=0' |
500 | + neutron-api: |
501 | + charm: cs:~plumgrid-team/trusty/neutron-api |
502 | + num_units: 1 |
503 | + options: |
504 | + neutron-plugin: plumgrid |
505 | + neutron-security-groups: false |
506 | + openstack-origin: cloud:trusty-kilo |
507 | + plumgrid-password: plumgrid |
508 | + plumgrid-username: plumgrid |
509 | + plumgrid-virtual-ip: 192.168.100.250 |
510 | + to: 'lxc:plumgrid-director=0' |
511 | + neutron-api-plumgrid: |
512 | + charm: cs:~plumgrid-team/trusty/neutron-api-plumgrid |
513 | + options: |
514 | + enable-metadata: True |
515 | + plumgrid-director: |
516 | + charm: cs:~plumgrid-team/trusty/plumgrid-director |
517 | + num_units: 1 |
518 | + constraints: "root-disk=30G mem=8G cpu-cores=8" |
519 | + options: |
520 | + plumgrid-virtual-ip: 192.168.100.250 |
521 | + nova-compute: |
522 | + charm: cs:~plumgrid-team/trusty/nova-compute |
523 | + num_units: 1 |
524 | + options: |
525 | + enable-live-migration: true |
526 | + enable-resize: true |
527 | + migration-auth-type: ssh |
528 | + openstack-origin: cloud:trusty-kilo |
529 | + to: '0' |
530 | + plumgrid-edge: |
531 | + charm: cs:~plumgrid-team/trusty/plumgrid-edge |
532 | + plumgrid-gateway: |
533 | + charm: cs:~plumgrid-team/trusty/plumgrid-gateway |
534 | + num_units: 1 |
535 | |
536 | === renamed file 'tests/files/plumgrid-edge-dense.yaml' => 'tests/files/plumgrid-edge-dense.yaml.moved' |
537 | === added file 'tests/tests.yaml' |
538 | --- tests/tests.yaml 1970-01-01 00:00:00 +0000 |
539 | +++ tests/tests.yaml 2016-03-03 21:45:16 +0000 |
540 | @@ -0,0 +1,2 @@ |
541 | +makefile: |
542 | + - lint |
543 | |
544 | === renamed file 'tests/tests.yaml' => 'tests/tests.yaml.moved' |
545 | === modified file 'unit_tests/test_pg_edge_context.py' |
546 | --- unit_tests/test_pg_edge_context.py 2015-08-24 16:22:15 +0000 |
547 | +++ unit_tests/test_pg_edge_context.py 2016-03-03 21:45:16 +0000 |
548 | @@ -37,8 +37,10 @@ |
549 | @patch.object(context, '_pg_dir_settings') |
550 | @patch.object(charmhelpers.contrib.openstack.context, |
551 | 'neutron_plugin_attribute') |
552 | - @patch.object(utils, 'check_interface_type') |
553 | - def test_neutroncc_context_api_rel(self, _int_type, _npa, _pg_dir_settings, |
554 | + @patch.object(utils, 'get_mgmt_interface') |
555 | + @patch.object(utils, 'get_fabric_interface') |
556 | + def test_neutroncc_context_api_rel(self, _fabric_int, _mgmt_int, |
557 | + _npa, _pg_dir_settings, |
558 | _save_flag_file, _config_flag, |
559 | _unit_get, _unit_priv_ip, _config, |
560 | _is_clus, _https, _ens_pkgs): |
561 | @@ -64,7 +66,8 @@ |
562 | _is_clus.return_value = False |
563 | _config_flag.return_value = False |
564 | _pg_dir_settings.return_value = {'pg_dir_ip': '192.168.100.201'} |
565 | - _int_type.return_value = 'juju-br0' |
566 | + _mgmt_int.return_value = 'juju-br0' |
567 | + _fabric_int.return_value = 'juju-br0' |
568 | napi_ctxt = context.PGEdgeContext() |
569 | expect = { |
570 | 'config': 'neutron.randomconfig', |
571 | @@ -74,8 +77,9 @@ |
572 | 'neutron_plugin': 'plumgrid', |
573 | 'neutron_security_groups': None, |
574 | 'neutron_url': 'https://192.168.100.201:9696', |
575 | - 'pg_hostname': 'pg-edge', |
576 | + 'pg_hostname': 'node0', |
577 | 'interface': 'juju-br0', |
578 | + 'fabric_interface': 'juju-br0', |
579 | 'label': 'node0', |
580 | 'fabric_mode': 'host', |
581 | 'neutron_alchemy_flags': False, |
582 | |
583 | === modified file 'unit_tests/test_pg_edge_hooks.py' |
584 | --- unit_tests/test_pg_edge_hooks.py 2015-08-16 19:07:22 +0000 |
585 | +++ unit_tests/test_pg_edge_hooks.py 2016-03-03 21:45:16 +0000 |
586 | @@ -83,21 +83,8 @@ |
587 | ) |
588 | |
589 | def test_config_changed_hook(self): |
590 | - _pkgs = ['plumgrid-lxc', 'iovisor-dkms'] |
591 | - self.add_lcm_key.return_value = 0 |
592 | - self.determine_packages.return_value = [_pkgs] |
593 | + self.add_lcm_key.return_value = 1 |
594 | self._call_hook('config-changed') |
595 | - self.stop_pg.assert_called_with() |
596 | - self.configure_sources.assert_called_with(update=True) |
597 | - self.apt_install.assert_has_calls([ |
598 | - call(_pkgs, fatal=True, |
599 | - options=['--force-yes']), |
600 | - ]) |
601 | - self.load_iovisor.assert_called_with() |
602 | - self.ensure_mtu.assert_called_with() |
603 | - self.ensure_files.assert_called_with() |
604 | - self.CONFIGS.write_all.assert_called_with() |
605 | - self.restart_pg.assert_called_with() |
606 | |
607 | def test_stop(self): |
608 | _pkgs = ['plumgrid-lxc', 'iovisor-dkms'] |
This item has failed automated testing! Results available here http:// juju-ci. vapour. ws:8080/ job/charm- bundle- test-lxc/ 2221/