Code review comment for ~nacc/git-ubuntu:bug-fixes-3

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

On 10.01.2018 [12:52:57 -0000], Andreas Hasenack wrote:
> Review: Needs Information
>
> One more question inline.
>
> Diff comments:
>
> > diff --git a/gitubuntu/build.py b/gitubuntu/build.py
> > index 072d3e7..06b491f 100644
> > --- a/gitubuntu/build.py
> > +++ b/gitubuntu/build.py
> > @@ -1026,17 +1037,29 @@ def do_build_lxd_exitstack(
> > time.sleep(retry_backoffs[i])
> > else:
> > raise RuntimeError(
> > - "Failed to run apt in ephemeral build container"
> > + "Failed to run apt-get in ephemeral build container"
> > )
> >
> > + # lxd assumes that if SNAP is set in the environment, that it is
> > + # running as a snap. That is not necessarily true when git-ubuntu is
> > + # the snapped application. So unset SNAP before we exec.
> > + # LP: #1741949
>
> Does this happen only with lxc push? There are other lxc commands we
> run elsewhere, like lxc pull, and lxc exec.

Only lxc push/pull care about the hostfs. Both have been updated to use
this env in this patch.

>
> > + env_unset_SNAP = os.environ.copy()
> > try:
> > - run([
> > - lxc,
> > - 'file',
> > - 'push',
> > - archive_tarball_name,
> > - '%s/tmp/' % container_name,
> > - ])
> > + del env_unset_SNAP['SNAP']
> > + except KeyError:
> > + pass
> > + try:
> > + run(
> > + [
> > + lxc,
> > + 'file',
> > + 'push',
> > + archive_tarball_name,
> > + '%s/tmp/' % container_name,
> > + ],
> > + env=env_unset_SNAP,
> > + )
> > except Exception as e:
> > raise RuntimeError(
> > "Failed to push archive tarball to ephemeral build container"

--
Nishanth Aravamudan
Ubuntu Server
Canonical Ltd

« Back to merge proposal