Merge lp:~james-page/charms/trusty/neutron-openvswitch/dkms-12.04 into lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next

Proposed by James Page
Status: Merged
Merged at revision: 87
Proposed branch: lp:~james-page/charms/trusty/neutron-openvswitch/dkms-12.04
Merge into: lp:~openstack-charmers-archive/charms/trusty/neutron-openvswitch/next
Diff against target: 59 lines (+24/-0)
2 files modified
hooks/neutron_ovs_utils.py (+8/-0)
unit_tests/test_neutron_ovs_utils.py (+16/-0)
To merge this branch: bzr merge lp:~james-page/charms/trusty/neutron-openvswitch/dkms-12.04
Reviewer Review Type Date Requested Status
OpenStack Charmers Pending
Review via email: mp+272390@code.launchpad.net

Description of the change

Avoids a race between openvswitch starting and the dkms module being available to load on 12.04.

To post a comment you must log in.
Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #10760 neutron-openvswitch-next for james-page mp272390
    LINT FAIL: lint-test failed

LINT Results (max last 2 lines):
make: *** [lint] Error 1
ERROR:root:Make target returned non-zero.

Full lint test output: http://paste.ubuntu.com/12554431/
Build: http://10.245.162.77:8080/job/charm_lint_check/10760/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #9938 neutron-openvswitch-next for james-page mp272390
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/9938/

88. By James Page

Tidy lint

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_unit_test #9939 neutron-openvswitch-next for james-page mp272390
    UNIT OK: passed

Build: http://10.245.162.77:8080/job/charm_unit_test/9939/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_lint_check #10761 neutron-openvswitch-next for james-page mp272390
    LINT OK: passed

Build: http://10.245.162.77:8080/job/charm_lint_check/10761/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #6765 neutron-openvswitch-next for james-page mp272390
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6765/

Revision history for this message
uosci-testing-bot (uosci-testing-bot) wrote :

charm_amulet_test #6766 neutron-openvswitch-next for james-page mp272390
    AMULET OK: passed

Build: http://10.245.162.77:8080/job/charm_amulet_test/6766/

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/neutron_ovs_utils.py'
2--- hooks/neutron_ovs_utils.py 2015-09-12 09:03:56 +0000
3+++ hooks/neutron_ovs_utils.py 2015-09-25 13:49:19 +0000
4@@ -26,6 +26,8 @@
5 )
6 from charmhelpers.contrib.openstack.neutron import (
7 parse_bridge_mappings,
8+ determine_dkms_package,
9+ headers_package,
10 )
11 from charmhelpers.contrib.openstack.context import (
12 ExternalPortContext,
13@@ -139,6 +141,12 @@
14
15 def install_packages():
16 apt_update()
17+ # NOTE(jamespage): ensure early install of dkms related
18+ # dependencies for kernels which need
19+ # openvswitch via dkms (12.04).
20+ dkms_packages = determine_dkms_package()
21+ if dkms_packages:
22+ apt_install([headers_package()] + dkms_packages, fatal=True)
23 apt_install(filter_installed_packages(determine_packages()))
24
25
26
27=== modified file 'unit_tests/test_neutron_ovs_utils.py'
28--- unit_tests/test_neutron_ovs_utils.py 2015-09-08 14:36:08 +0000
29+++ unit_tests/test_neutron_ovs_utils.py 2015-09-25 13:49:19 +0000
30@@ -28,6 +28,8 @@
31 'service_restart',
32 'service_running',
33 'ExternalPortContext',
34+ 'determine_dkms_package',
35+ 'headers_package',
36 ]
37
38 head_pkg = 'linux-headers-3.15.0-5-generic'
39@@ -85,6 +87,20 @@
40 self.apt_update.assert_called_with()
41 self.apt_install.assert_called_with(self.filter_installed_packages())
42
43+ @patch.object(nutils, 'determine_packages')
44+ def test_install_packages_dkms_needed(self, _determine_packages):
45+ _determine_packages.return_value = 'randompkg'
46+ self.determine_dkms_package.return_value = \
47+ ['openvswitch-datapath-dkms']
48+ self.headers_package.return_value = 'linux-headers-foobar'
49+ nutils.install_packages()
50+ self.apt_update.assert_called_with()
51+ self.apt_install.assert_has_calls([
52+ call(['linux-headers-foobar',
53+ 'openvswitch-datapath-dkms'], fatal=True),
54+ call(self.filter_installed_packages()),
55+ ])
56+
57 @patch.object(nutils, 'use_dvr')
58 @patch.object(nutils, 'git_install_requested')
59 @patch.object(charmhelpers.contrib.openstack.neutron, 'os_release')

Subscribers

People subscribed via source and target branches