Merge lp:~larryprice/libertine/lxc-kernel-verify into lp:libertine

Proposed by Larry Price
Status: Merged
Approved by: Christopher Townsend
Approved revision: 266
Merged at revision: 265
Proposed branch: lp:~larryprice/libertine/lxc-kernel-verify
Merge into: lp:libertine
Prerequisite: lp:~larryprice/libertine/focus-issues
Diff against target: 39 lines (+9/-5)
2 files modified
python/libertine/HostInfo.py (+5/-5)
tools/libertine-container-manager (+4/-0)
To merge this branch: bzr merge lp:~larryprice/libertine/lxc-kernel-verify
Reviewer Review Type Date Requested Status
Christopher Townsend Approve
Libertine CI Bot continuous-integration Approve
Review via email: mp+299237@code.launchpad.net

Commit message

Verify host kernel has lxc support.

Description of the change

Verify host kernel has lxc support.

To post a comment you must log in.
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:266
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/40/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/155
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=default/117
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/117
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=default/117
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=vivid+overlay,testname=default/117
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/117
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=yakkety,testname=default/117
    None: https://jenkins.canonical.com/libertine/job/lp-generic-update-mp/125/console
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/158
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=vivid+overlay/143
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=xenial+overlay/143
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=yakkety/143
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/136
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/136/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/136
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/136/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/136
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/136/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/136
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/136/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/136
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/136/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/136
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/136/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/40/rebuild

review: Approve (continuous-integration)
Revision history for this message
Christopher Townsend (townsend) wrote :

Ok, good.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'python/libertine/HostInfo.py'
2--- python/libertine/HostInfo.py 2016-06-28 14:30:01 +0000
3+++ python/libertine/HostInfo.py 2016-07-05 20:51:32 +0000
4@@ -22,15 +22,15 @@
5 class HostInfo(object):
6
7 def select_container_type_by_kernel(self):
8- kernel_release = platform.release().split('.')
9-
10- if int(kernel_release[0]) >= 4:
11- return "lxc"
12- elif int(kernel_release[0]) == 3 and int(kernel_release[1]) >= 13:
13+ if has_lxc_support():
14 return "lxc"
15 else:
16 return "chroot"
17
18+ def has_lxc_support(self):
19+ kernel_release = platform.release().split('.')
20+ return int(kernel_release[0]) >= 4 or (int(kernel_release[0]) == 3 and int(kernel_release[1]) >= 13)
21+
22 def get_host_distro_release(self):
23 distinfo = lsb_release.get_distro_information()
24
25
26=== modified file 'tools/libertine-container-manager'
27--- tools/libertine-container-manager 2016-06-28 14:30:01 +0000
28+++ tools/libertine-container-manager 2016-07-05 20:51:32 +0000
29@@ -50,6 +50,10 @@
30 if not args.type:
31 container_type = self.host_info.select_container_type_by_kernel()
32 else:
33+ if args.type == 'lxc' and not self.host_info.has_lxc_support():
34+ print("System kernel does not support lxc type containers. "
35+ "Please either use chroot or omit the -t option.")
36+ sys.exit(1)
37 container_type = args.type
38
39 if not args.distro:

Subscribers

People subscribed via source and target branches