Merge lp:~larryprice/libertine/saved-lxd-root into lp:libertine

Proposed by Larry Price
Status: Merged
Approved by: Christopher Townsend
Approved revision: 400
Merged at revision: 419
Proposed branch: lp:~larryprice/libertine/saved-lxd-root
Merge into: lp:libertine
Diff against target: 15 lines (+4/-0)
1 file modified
python/libertine/LxdContainer.py (+4/-0)
To merge this branch: bzr merge lp:~larryprice/libertine/saved-lxd-root
Reviewer Review Type Date Requested Status
Christopher Townsend Approve
Libertine CI Bot continuous-integration Approve
Review via email: mp+318227@code.launchpad.net

Commit message

Keep the original root path around when updating bind mounts in lxd.

Description of the change

Keep the original root path around when updating bind mounts in lxd.

On latest zesty, defining the root path causes a bind mount save error. On x+o, not defining the root path causes a bind mount save error. The reason we originally defined it was because it was a "default" device pre-created on container creation by lxd; this is no longer the case and my assumption is that they deal with it internally (especially since '/' is the only allowed value). The solution here is to save it if it exists; otherwise pretend it's not there.

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

PASSED: Continuous integration, rev:400
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/413/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/776
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/640
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=zesty,testname=default/640
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/640
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=zesty,testname=default/640
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/786
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/767
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/767/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/767
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=zesty/767/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/767
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/767/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/767
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=zesty/767/artifact/output/*zip*/output.zip

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

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

Ok, works for me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'python/libertine/LxdContainer.py'
2--- python/libertine/LxdContainer.py 2017-02-22 19:04:25 +0000
3+++ python/libertine/LxdContainer.py 2017-02-24 14:06:50 +0000
4@@ -217,7 +217,11 @@
5 def update_bind_mounts(container, config, home_path):
6 userdata_dir = utils.get_libertine_container_home_dir(container.name)
7
8+ old_root = container.devices.get('root')
9 container.devices.clear()
10+ if old_root:
11+ container.devices['root'] = old_root
12+
13 container.devices['home'] = {'type': 'disk', 'path': home_path, 'source': userdata_dir}
14
15 # applications and icons directories

Subscribers

People subscribed via source and target branches