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
1diff --git a/curtin/commands/curthooks.py b/curtin/commands/curthooks.py
2index d45c3a8..a514560 100644
3--- a/curtin/commands/curthooks.py
4+++ b/curtin/commands/curthooks.py
5@@ -292,7 +292,7 @@ def setup_grub(cfg, target):
6 storage_cfg_odict = None
7 try:
8 storage_cfg_odict = extract_storage_ordered_dict(cfg)
9- except ValueError as e:
10+ except ValueError:
11 pass
12
13 if storage_cfg_odict:
14@@ -324,7 +324,7 @@ def setup_grub(cfg, target):
15 try:
16 (blockdev, part) = block.get_blockdev_for_partition(maybepart)
17 blockdevs.add(blockdev)
18- except ValueError as e:
19+ except ValueError:
20 # if there is no syspath for this device such as a lvm
21 # or raid device, then a ValueError is raised here.
22 LOG.debug("failed to find block device for %s", maybepart)
23diff --git a/curtin/url_helper.py b/curtin/url_helper.py
24index d4d43a9..43c5c36 100644
25--- a/curtin/url_helper.py
26+++ b/curtin/url_helper.py
27@@ -227,7 +227,7 @@ def geturl(url, headers=None, headers_cb=None, exception_cb=None,
28 try:
29 return _geturl(url=url, headers=headers, headers_cb=headers_cb,
30 exception_cb=exception_cb, data=data)
31- except _ReRaisedException as e:
32+ except _ReRaisedException:
33 raise curexc.exc
34 except Exception as e:
35 curexc = e
36diff --git a/tests/vmtests/__init__.py b/tests/vmtests/__init__.py
37index 5c30a83..0c3d17e 100644
38--- a/tests/vmtests/__init__.py
39+++ b/tests/vmtests/__init__.py
40@@ -1091,7 +1091,7 @@ class VMBaseClass(TestCase):
41 # mount output disk
42 try:
43 cls.collect_output()
44- except Exception as e:
45+ except Exception:
46 cls.tearDownClass()
47 raise
48
49diff --git a/tests/vmtests/image_sync.py b/tests/vmtests/image_sync.py
50index bbe523a..e2cedc1 100644
51--- a/tests/vmtests/image_sync.py
52+++ b/tests/vmtests/image_sync.py
53@@ -174,7 +174,7 @@ class CurtinVmTestMirror(mirrors.ObjectFilterMirror):
54 except IOError as e:
55 if e.errno != errno.ENOENT:
56 raise
57- except JSONDecodeError as e:
58+ except JSONDecodeError:
59 jsonfile = os.path.join(self.out_d, dpath)
60 sys.stderr.write("Decode error in:\n "
61 "content_id=%s\n "

Subscribers

People subscribed via source and target branches