original lsb-release file should be preserved for classic mode

Bug #1650207 reported by Oliver Grawert on 2016-12-15
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
Snappy
Undecided
Unassigned
livecd-rootfs (Ubuntu)
Medium
Oliver Grawert

Bug Description

when installing the classic snap the modified /etc/lsb-release and /etc/os-release are used inside the tarball. when compiling code that uses the content of these files at build time they get the wrong info:

DISTRIB_ID="Ubuntu Core"
DISTRIB_RELEASE=16
DISTRIB_DESCRIPTION="Ubuntu Core 16"

vs:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="Ubuntu 16.04.1 LTS"

we should preserve the original data for these two files and use it inside the classic container when the classic snap is installed, so build environments can match against the correct data.

Dan Kegel (dank) wrote :

/etc/issue, too, plz :-)

Dan Kegel (obdank) wrote :

And /etc/os-release. Symptom: 'pip install' aborts with

  File "/home/buildbot/master-state/sandbox/local/lib/python2.7/site-packages/pip/_vendor/distro.py", line 876, in _parse_os_release_content
    tokens = list(lexer)
  File "/usr/lib/python2.7/shlex.py", line 269, in next
    token = self.get_token()
  File "/usr/lib/python2.7/shlex.py", line 96, in get_token
    raw = self.read_token()
  File "/usr/lib/python2.7/shlex.py", line 172, in read_token
    raise ValueError, "No closing quotation"

Kyle Fazzari (kyrofa) wrote :

Yeah, hit this today:

$ python3
Python 3.5.2 (default, Nov 17 2016, 17:05:23)
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import lsb_release
>>> lsb_release.get_distro_information()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 383, in get_distro_information
    distinfo = guess_debian_release()
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 281, in guess_debian_release
    get_distro_info(distinfo['ID'])
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 41, in get_distro_info
    RELEASES_ORDER.sort(key=lambda n: float(n[0]))
  File "/usr/lib/python3/dist-packages/lsb_release.py", line 41, in <lambda>
    RELEASES_ORDER.sort(key=lambda n: float(n[0]))
ValueError: could not convert string to float: '8.04 LTS'

Although that's just due to the fact that it's missing the DISTRIB_CODENAME. Add that back and I think I'll be happy.

Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in livecd-rootfs (Ubuntu):
status: New → Confirmed
Kyle Fazzari (kyrofa) wrote :

Note that snapcraft doesn't exclude libraries correctly when that file is different than xenial's either.

Oliver Grawert (ogra) on 2017-01-26
Changed in livecd-rootfs (Ubuntu):
importance: Undecided → Medium
assignee: nobody → Oliver Grawert (ogra)
Frédéric Bolduc (ferdbold) wrote :

I've been hitting the same bug as kyrofa when running add-apt-repository, although my /etc/lsb-release/ seems to look fine:

DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=16.04
DISTRIB_CODENAME=xenial
DISTRIB_DESCRIPTION="GalliumOS 2.0"

Could this be another issue entirely?

Oliver Grawert (ogra) wrote :

fixed in the latest edge core snap: http://paste.ubuntu.com/23874513/

note that you need to snap remove classic/snap install --devmode --edge classic && sudo classic
to re-generate the chroot on existing installs for the fix to apply.

Changed in livecd-rootfs (Ubuntu):
status: Confirmed → Fix Committed
Changed in snappy:
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Duplicates of this bug

Other bug subscribers