Merge ~smoser/curtin:fix/pyflakes-2.0.0-reported-issues into curtin:master

Proposed by Scott Moser
Status: Merged
Approved by: Scott Moser
Approved revision: 1273f99d90b1a2c7d6611480790fa4725b50f4e5
Merge reported by: Scott Moser
Merged at revision: 48b24ca6f3f440437814c03fae478f0059161352
Proposed branch: ~smoser/curtin:fix/pyflakes-2.0.0-reported-issues
Merge into: curtin:master
Diff against target: 61 lines (+5/-5)
4 files modified
curtin/commands/curthooks.py (+2/-2)
curtin/url_helper.py (+1/-1)
tests/vmtests/__init__.py (+1/-1)
tests/vmtests/image_sync.py (+1/-1)
Reviewer Review Type Date Requested Status
Scott Moser (community) Approve
Server Team CI bot continuous-integration Approve
Ryan Harper (community) Approve
Review via email: mp+346412@code.launchpad.net

Commit message

pyflakes: fix unused variable references identified by pyflakes 2.0.0.

A newer version of pyflakes (2.0.0) was released over the last weekend.
It identifed some unused variables that version 1.6.0 did not identify.
The change here merely fixes those unused variables.

The fact that c-i hit this is not intended. A future fix is needed to
properly pin the version of pyflakes so that it does not happen again.

Description of the change

see commit message

To post a comment you must log in.
Revision history for this message
Ryan Harper (raharper) wrote :

Good fixes.

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

failure in first c-i run was filed as bug 1772481

failure was not related to this code, so landing this.

review: Approve
Revision history for this message
Scott Moser (smoser) wrote :

An upstream commit landed for this bug.

To view that commit see the following URL:
https://git.launchpad.net/curtin/commit/?id=48b24ca6

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/curtin/commands/curthooks.py b/curtin/commands/curthooks.py
index d45c3a8..a514560 100644
--- a/curtin/commands/curthooks.py
+++ b/curtin/commands/curthooks.py
@@ -292,7 +292,7 @@ def setup_grub(cfg, target):
292 storage_cfg_odict = None292 storage_cfg_odict = None
293 try:293 try:
294 storage_cfg_odict = extract_storage_ordered_dict(cfg)294 storage_cfg_odict = extract_storage_ordered_dict(cfg)
295 except ValueError as e:295 except ValueError:
296 pass296 pass
297297
298 if storage_cfg_odict:298 if storage_cfg_odict:
@@ -324,7 +324,7 @@ def setup_grub(cfg, target):
324 try:324 try:
325 (blockdev, part) = block.get_blockdev_for_partition(maybepart)325 (blockdev, part) = block.get_blockdev_for_partition(maybepart)
326 blockdevs.add(blockdev)326 blockdevs.add(blockdev)
327 except ValueError as e:327 except ValueError:
328 # if there is no syspath for this device such as a lvm328 # if there is no syspath for this device such as a lvm
329 # or raid device, then a ValueError is raised here.329 # or raid device, then a ValueError is raised here.
330 LOG.debug("failed to find block device for %s", maybepart)330 LOG.debug("failed to find block device for %s", maybepart)
diff --git a/curtin/url_helper.py b/curtin/url_helper.py
index d4d43a9..43c5c36 100644
--- a/curtin/url_helper.py
+++ b/curtin/url_helper.py
@@ -227,7 +227,7 @@ def geturl(url, headers=None, headers_cb=None, exception_cb=None,
227 try:227 try:
228 return _geturl(url=url, headers=headers, headers_cb=headers_cb,228 return _geturl(url=url, headers=headers, headers_cb=headers_cb,
229 exception_cb=exception_cb, data=data)229 exception_cb=exception_cb, data=data)
230 except _ReRaisedException as e:230 except _ReRaisedException:
231 raise curexc.exc231 raise curexc.exc
232 except Exception as e:232 except Exception as e:
233 curexc = e233 curexc = e
diff --git a/tests/vmtests/__init__.py b/tests/vmtests/__init__.py
index 5c30a83..0c3d17e 100644
--- a/tests/vmtests/__init__.py
+++ b/tests/vmtests/__init__.py
@@ -1091,7 +1091,7 @@ class VMBaseClass(TestCase):
1091 # mount output disk1091 # mount output disk
1092 try:1092 try:
1093 cls.collect_output()1093 cls.collect_output()
1094 except Exception as e:1094 except Exception:
1095 cls.tearDownClass()1095 cls.tearDownClass()
1096 raise1096 raise
10971097
diff --git a/tests/vmtests/image_sync.py b/tests/vmtests/image_sync.py
index bbe523a..e2cedc1 100644
--- a/tests/vmtests/image_sync.py
+++ b/tests/vmtests/image_sync.py
@@ -174,7 +174,7 @@ class CurtinVmTestMirror(mirrors.ObjectFilterMirror):
174 except IOError as e:174 except IOError as e:
175 if e.errno != errno.ENOENT:175 if e.errno != errno.ENOENT:
176 raise176 raise
177 except JSONDecodeError as e:177 except JSONDecodeError:
178 jsonfile = os.path.join(self.out_d, dpath)178 jsonfile = os.path.join(self.out_d, dpath)
179 sys.stderr.write("Decode error in:\n "179 sys.stderr.write("Decode error in:\n "
180 "content_id=%s\n "180 "content_id=%s\n "

Subscribers

People subscribed via source and target branches