Merge ~jslarraz/review-tools:fix-plasma into review-tools:master

Proposed by Jorge Sancho Larraz
Status: Merged
Merged at revision: 220620a1a53e4f24bd597231881f95b327c8b91a
Proposed branch: ~jslarraz/review-tools:fix-plasma
Merge into: review-tools:master
Diff against target: 61 lines (+15/-7)
2 files modified
bin/snap-review (+7/-4)
reviewtools/containers/squashfs_container.py (+8/-3)
Reviewer Review Type Date Requested Status
Alex Murray Approve
Review via email: mp+466848@code.launchpad.net

Commit message

Fix for the error mentioned in https://code.launchpad.net/~evancaville/review-tools/+git/review-tools/+merge/466828

The expected outcome is review tools raising a Runtime exception related to unsquashfs failing (it finds some files with xattr). The review should fail because of this runtime exception

To post a comment you must log in.
Revision history for this message
Alex Murray (alexmurray) wrote :

LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/bin/snap-review b/bin/snap-review
index 777f418..299473e 100755
--- a/bin/snap-review
+++ b/bin/snap-review
@@ -9,7 +9,7 @@ import shutil
9import sys9import sys
10import tempfile10import tempfile
11import textwrap11import textwrap
12import traceback12import logging
1313
14from reviewtools.common import (14from reviewtools.common import (
15 MKDTEMP_PREFIX,15 MKDTEMP_PREFIX,
@@ -150,9 +150,12 @@ def main():
150150
151 review_report = review.do_checks()151 review_report = review.do_checks()
152 report.update(review_report)152 report.update(review_report)
153 except Exception:153 except Exception as e:
154 print("Caught exception (setting rc=1 and continuing):")154 if args.verbose:
155 traceback.print_exc(file=sys.stdout)155 logging.exception("Caught exception (setting rc=1 and continuing):")
156 report.add_result(
157 "runtime-errors", "error", "msg", str(e), manual_review=True
158 )
156 rc = 1159 rc = 1
157160
158 # Write out our state161 # Write out our state
diff --git a/reviewtools/containers/squashfs_container.py b/reviewtools/containers/squashfs_container.py
index 4896bbb..9ebd26d 100644
--- a/reviewtools/containers/squashfs_container.py
+++ b/reviewtools/containers/squashfs_container.py
@@ -1,6 +1,11 @@
1import os1import os
2import shutil2import shutil
3from reviewtools.common import cmd, cmdIgnoreErrorStrings, UNSQUASHFS_IGNORED_ERRORS3from reviewtools.common import (
4 cmd,
5 cmdIgnoreErrorStrings,
6 UNSQUASHFS_IGNORED_ERRORS,
7 recursive_rm,
8)
4from reviewtools.containers.base_container import BaseContainer, ContainerException9from reviewtools.containers.base_container import BaseContainer, ContainerException
510
611
@@ -89,12 +94,12 @@ class SquashfsContainer(BaseContainer):
89 (rc, out) = cmdIgnoreErrorStrings(cmd, UNSQUASHFS_IGNORED_ERRORS)94 (rc, out) = cmdIgnoreErrorStrings(cmd, UNSQUASHFS_IGNORED_ERRORS)
90 if rc != 0:95 if rc != 0:
91 if os.path.isdir(stage_dir):96 if os.path.isdir(stage_dir):
92 shutil.rmtree(stage_dir)97 recursive_rm(stage_dir)
93 raise RuntimeError("unpacking failed with '%d':\n%s" % (rc, out))98 raise RuntimeError("unpacking failed with '%d':\n%s" % (rc, out))
9499
95 # Update on success100 # Update on success
96 if self._unpack_dir is not None and os.path.exists(self._unpack_dir):101 if self._unpack_dir is not None and os.path.exists(self._unpack_dir):
97 shutil.rmtree(self._unpack_dir)102 recursive_rm(self._unpack_dir)
98 self._unpack_dir = ".".join(self.filename.split(".")[:-1])103 self._unpack_dir = ".".join(self.filename.split(".")[:-1])
99 shutil.move(stage_dir, self._unpack_dir)104 shutil.move(stage_dir, self._unpack_dir)
100 return self._unpack_dir105 return self._unpack_dir

Subscribers

People subscribed via source and target branches