Merge lp:~larryprice/libertine/lxd-default into lp:libertine

Proposed by Larry Price
Status: Merged
Approved by: Christopher Townsend
Approved revision: 402
Merged at revision: 420
Proposed branch: lp:~larryprice/libertine/lxd-default
Merge into: lp:libertine
Prerequisite: lp:~larryprice/libertine/saved-lxd-root
Diff against target: 87 lines (+18/-12)
4 files modified
python/libertine/HostInfo.py (+8/-5)
python/libertine/service/tasks/create_task.py (+4/-2)
tools/libertine-container-manager (+5/-4)
tools/libertine-container-manager.1 (+1/-1)
To merge this branch: bzr merge lp:~larryprice/libertine/lxd-default
Reviewer Review Type Date Requested Status
Christopher Townsend Approve
Libertine CI Bot continuous-integration Approve
Review via email: mp+318238@code.launchpad.net

Commit message

Update the default container type to lxd.

Description of the change

Update the default container type to lxd.

To post a comment you must log in.
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :
review: Needs Fixing (continuous-integration)
lp:~larryprice/libertine/lxd-default updated
402. By Larry Price

oops remove debug

Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:402
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/416/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/782
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/645
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/645
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/645
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/645
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/792
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/773
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/773/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/773
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/773/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/773
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/773/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/773
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/773/artifact/output/*zip*/output.zip

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

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

+1

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 2017-01-13 20:16:54 +0000
3+++ python/libertine/HostInfo.py 2017-02-24 15:44:09 +0000
4@@ -25,11 +25,10 @@
5 class HostInfo(object):
6
7 def select_container_type_by_kernel(self):
8- if self.has_lxc_support():
9- if libertine.utils.is_snap_environment():
10- return "lxd"
11- else:
12- return "lxc"
13+ if self.has_lxd_support():
14+ return "lxd"
15+ elif self.has_lxc_support():
16+ return "lxc"
17 else:
18 return "chroot"
19
20@@ -37,6 +36,10 @@
21 kernel_release = platform.release().split('.')
22 return int(kernel_release[0]) >= 4 or (int(kernel_release[0]) == 3 and int(kernel_release[1]) >= 13)
23
24+ def has_lxd_support(self):
25+ kernel_release = platform.release().split('.')
26+ return int(kernel_release[0]) >= 4 or (int(kernel_release[0]) == 4)
27+
28 def get_host_distro_release(self):
29 distinfo = lsb_release.get_distro_information()
30
31
32=== modified file 'python/libertine/service/tasks/create_task.py'
33--- python/libertine/service/tasks/create_task.py 2016-11-01 18:50:32 +0000
34+++ python/libertine/service/tasks/create_task.py 2017-02-24 15:44:09 +0000
35@@ -56,8 +56,10 @@
36
37 if not self._type:
38 self._type = info.select_container_type_by_kernel()
39- elif self._type == 'lxc' and not info.has_lxc_support():
40- self._progress.error("System kernel does not support lxc type containers. Please either use chroot or leave empty.")
41+ elif (self._type == 'lxd' and not info.has_lxd_support()) or \
42+ (self._type == 'lxc' and not info.has_lxc_support()):
43+ self._progress.error("System kernel does not support %s type containers. "
44+ "Please either use chroot or leave empty." % self._type)
45 return False
46
47 if not self._name:
48
49=== modified file 'tools/libertine-container-manager'
50--- tools/libertine-container-manager 2017-02-23 21:08:28 +0000
51+++ tools/libertine-container-manager 2017-02-24 15:44:09 +0000
52@@ -60,9 +60,10 @@
53 if not args.type:
54 container_type = self.host_info.select_container_type_by_kernel()
55 else:
56- if (args.type == 'lxc' or args.type == 'lxd') and not self.host_info.has_lxc_support():
57- libertine.utils.get_logger().error("System kernel does not support lxc type containers. "
58- "Please either use chroot or omit the -t option.")
59+ if (args.type == 'lxc' and not self.host_info.has_lxc_support()) or \
60+ (args.type == 'lxd' and not self.host_info.has_lxd_support()):
61+ libertine.utils.get_logger().error("System kernel does not support %s type containers. "
62+ "Please either use chroot or omit the -t option." % args.type)
63 sys.exit(1)
64 container_type = args.type
65
66@@ -428,7 +429,7 @@
67 help=("Container identifier of form ([a-z0-9][a-z0-9+.-]+). Required."))
68 parser_create.add_argument(
69 '-t', '--type',
70- help=("Type of Libertine container to create. Either 'lxc' or 'chroot'."))
71+ help=("Type of Libertine container to create. Either 'lxd', 'lxc' or 'chroot'."))
72 parser_create.add_argument(
73 '-d', '--distro',
74 help=("Ubuntu distro series to create."))
75
76=== modified file 'tools/libertine-container-manager.1'
77--- tools/libertine-container-manager.1 2017-02-02 16:31:07 +0000
78+++ tools/libertine-container-manager.1 2017-02-24 15:44:09 +0000
79@@ -89,7 +89,7 @@
80 .IP
81 .BR \-t " TYPE, " \-\-type " TYPE" ""
82 .RS 14
83-Type of Libertine container to create. Either 'lxc' or 'chroot'.
84+Type of Libertine container to create. Either 'lxd', 'lxc' or 'chroot'.
85 .RE
86 .IP
87 .BR \-\-password " password" ""

Subscribers

People subscribed via source and target branches