Merge lp:~townsend/libertine/fix-create-lxc-log into lp:libertine

Proposed by Christopher Townsend
Status: Merged
Approved by: Larry Price
Approved revision: 355
Merged at revision: 355
Proposed branch: lp:~townsend/libertine/fix-create-lxc-log
Merge into: lp:libertine
Diff against target: 28 lines (+6/-1)
1 file modified
python/libertine/LxcContainer.py (+6/-1)
To merge this branch: bzr merge lp:~townsend/libertine/fix-create-lxc-log
Reviewer Review Type Date Requested Status
Larry Price Approve
Libertine CI Bot continuous-integration Approve
Review via email: mp+314101@code.launchpad.net

Commit message

Only set the lxc log when a container is defined during class init. Also, load the default config first and then set the lxc log when creating a new lxc container.

To post a comment you must log in.
Revision history for this message
Christopher Townsend (townsend) wrote :

Hmm, lxc.logfile is being added to the config file in the container's directory. Need to fix that...

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

PASSED: Continuous integration, rev:355
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/293/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/597
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/484
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/484
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/484
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/484
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/607
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/589
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/589/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/589
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/589/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/589
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/589/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/589
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/589/artifact/output/*zip*/output.zip

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

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

Ok, the lxc.logfile entry is harmless as the new temp location is used when _set_lxc_log() is called during another operation. I'll leave the line in there as the alternative to work around that is ugly.

Revision history for this message
Larry Price (larryprice) wrote :

lgtm, though upstream lxc seems to be broken on zesty -_-

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'python/libertine/LxcContainer.py'
2--- python/libertine/LxcContainer.py 2016-11-21 17:18:55 +0000
3+++ python/libertine/LxcContainer.py 2017-01-04 16:39:29 +0000
4@@ -130,11 +130,13 @@
5 super().__init__(container_id)
6 self.container_type = "lxc"
7 self.container = lxc_container(container_id)
8- self._set_lxc_log()
9 self.lxc_manager_interface = None
10 self.window_manager = None
11 self.host_info = HostInfo.HostInfo()
12
13+ if self.container.defined:
14+ self._set_lxc_log()
15+
16 utils.set_session_dbus_env_var()
17
18 try:
19@@ -220,6 +222,9 @@
20 fd.write("lxc.id_map = u %s %s %s\n" % (user_id + 1, (user_id + 1) + 100000, 65536 - (user_id + 1)))
21 fd.write("lxc.id_map = g %s %s %s\n" % (group_id + 1, (group_id + 1) + 100000, 65536 - (user_id + 1)))
22
23+ self.container.load_config(config_file)
24+ self._set_lxc_log()
25+
26 utils.create_libertine_user_data_dir(self.container_id)
27
28 with EnvLxcSettings():

Subscribers

People subscribed via source and target branches