Merge ~sylvain-pineau/checkbox-core-snap:fix-distro.py into checkbox-core-snap:master

Proposed by Sylvain Pineau
Status: Merged
Approved by: Sylvain Pineau
Approved revision: 57f5af0255ac19c8c447ebd01be756138c6e4d37
Merged at revision: cb5eaffddda5cf98870f2397e1907bf4c80482b8
Proposed branch: ~sylvain-pineau/checkbox-core-snap:fix-distro.py
Merge into: checkbox-core-snap:master
Diff against target: 14 lines (+3/-0)
1 file modified
snap/snapcraft.yaml (+3/-0)
Reviewer Review Type Date Requested Status
Sylvain Pineau (community) Approve
Review via email: mp+391111@code.launchpad.net

Description of the change

A workaround for the following bug in disk/encryption/detect:
Traceback (most recent call last):
  File "/tmp/nest-mav1g_lc.fc4053f952a3fdcf8d136d9400267094201a1aea39f78bd12a8f040dec0d108f/fde_tests.py", line 106, in <module>
    main()
  File "/tmp/nest-mav1g_lc.fc4053f952a3fdcf8d136d9400267094201a1aea39f78bd12a8f040dec0d108f/fde_tests.py", line 33, in main
    if int(get_series()) >= 20:
  File "/snap/checkbox-tillamook/38/checkbox-runtime/lib/python3.5/site-packages/checkbox_support/snap_utils/system.py", line 24, in get_series
    return distro.version()
  File "/snap/checkbox-tillamook/38/checkbox-runtime/lib/python3.5/site-packages/distro.py", line 287, in version
    return _distro.version(pretty, best)
  File "/snap/checkbox-tillamook/38/checkbox-runtime/lib/python3.5/site-packages/distro.py", line 741, in version
    self.lsb_release_attr('release'),
  File "/snap/checkbox-tillamook/38/checkbox-runtime/lib/python3.5/site-packages/distro.py", line 903, in lsb_release_attr
    return self._lsb_release_info.get(attribute, '')
  File "/snap/checkbox-tillamook/38/checkbox-runtime/lib/python3.5/site-packages/distro.py", line 556, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)
  File "/snap/checkbox-tillamook/38/checkbox-runtime/lib/python3.5/site-packages/distro.py", line 1014, in _lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)
  File "/snap/checkbox-tillamook/38/checkbox-runtime/usr/lib/python3.5/subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "/snap/checkbox-tillamook/38/checkbox-runtime/usr/lib/python3.5/subprocess.py", line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1

To post a comment you must log in.
Revision history for this message
Sylvain Pineau (sylvain-pineau) wrote :

I'm landing this patch to monitor the next edge builds test results.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/snap/snapcraft.yaml b/snap/snapcraft.yaml
2index 4c2019a..af6e87c 100644
3--- a/snap/snapcraft.yaml
4+++ b/snap/snapcraft.yaml
5@@ -146,6 +146,9 @@ parts:
6 - -**/__pycache__
7 build-environment:
8 - PYTHONPATH: $SNAPCRAFT_PART_INSTALL/usr/lib/python3/dist-packages:$PYTHONPATH
9+ override-stage: |
10+ snapcraftctl stage
11+ sed -i 's|except OSError: # Command not found|except subprocess.CalledProcessError: # Command not found|g' lib/python3.*/site-packages/distro.py
12 ################################################################################
13 checkbox-ng:
14 source-tag: ""

Subscribers

People subscribed via source and target branches