Merge ~nacc/git-ubuntu:lp1741949-unset-SNAP-calling-lxc into git-ubuntu:master

Proposed by Nish Aravamudan
Status: Rejected
Rejected by: Nish Aravamudan
Proposed branch: ~nacc/git-ubuntu:lp1741949-unset-SNAP-calling-lxc
Merge into: git-ubuntu:master
Diff against target: 21 lines (+10/-0)
1 file modified
gitubuntu/build.py (+10/-0)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Needs Fixing
git-ubuntu developers Pending
Review via email: mp+335900@code.launchpad.net

Description of the change

Make jenkins happy.

To post a comment you must log in.
Revision history for this message
Robie Basak (racb) wrote :

If this is a workaround, please could we have a Launchpad bug on the underlying issue and then refer to that bug in a comment?

Revision history for this message
Nish Aravamudan (nacc) wrote :

I mean we have a bug (it's linked to this MP). I'm happy to add a comment inline.

8b21c8e... by Nish Aravamudan

add launchpad bug reference in comment

Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:769c6756610bc480c65d5127948b52381119b67a
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/234/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Style Check
    SUCCESS: Unit Tests
    FAILED: Integration Tests

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/234/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

FAILED: Continuous integration, rev:8b21c8e7bcaaa22fcfcbf73526d4b916cf51606e
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/235/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Style Check
    SUCCESS: Unit Tests
    FAILED: Integration Tests

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/git-ubuntu-ci/235/rebuild

review: Needs Fixing (continuous-integration)
Revision history for this message
Nish Aravamudan (nacc) wrote :

Unmerged commits

8b21c8e... by Nish Aravamudan

add launchpad bug reference in comment

769c675... by Nish Aravamudan

build: unset SNAP in lxc's env

Ever since lxc gained snap support, it assumed that if SNAP is set in
it's environment that lxc itself was running as a SNAP. This is not
necessarily the case when git-ubuntu itself is a classic snap (and thus
has SNAP set in its environment) but is calling lxc in the host. Unset
SNAP manually on lxc run() calls.

LP: #1741949

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/gitubuntu/build.py b/gitubuntu/build.py
2index 072d3e7..a476702 100644
3--- a/gitubuntu/build.py
4+++ b/gitubuntu/build.py
5@@ -946,6 +946,16 @@ def _run_in_lxd(container_name, args, user=None, **kwargs):
6 raise
7 cmd.extend(['sudo', '-s', '-H', '-u', user,])
8 cmd.extend(args)
9+ # lxd assumes that if SNAP is set in the environment, that it is
10+ # running as a snap. That is not necessarily true when git-ubuntu is
11+ # the snapped application. So unset SNAP before we exec.
12+ # LP: #1741949
13+ try:
14+ env = kwargs['env']
15+ except KeyError:
16+ env = dict()
17+ env.update({'SNAP': ""})
18+ kwargs['env'] = env
19 return run(cmd, **kwargs)
20
21 def do_build_lxd_exitstack(

Subscribers

People subscribed via source and target branches