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

Proposed by Scott Moser
Status: Merged
Approved by: Scott Moser
Approved revision: a50bd3850e86029b1f07b65521976553caa2f167
Merge reported by: Scott Moser
Merged at revision: 4ba4639b86edad7ec89a55a61b7d9075f92d2166
Proposed branch: ~smoser/cloud-init:fix/pyflakes-2.0.0-reported-issues
Merge into: cloud-init:master
Diff against target: 110 lines (+15/-15)
6 files modified
cloudinit/config/cc_mounts.py (+1/-1)
cloudinit/handlers/upstart_job.py (+1/-1)
cloudinit/sources/DataSourceAltCloud.py (+8/-8)
cloudinit/sources/DataSourceNoCloud.py (+2/-2)
cloudinit/sources/DataSourceOpenNebula.py (+1/-1)
cloudinit/util.py (+2/-2)
Reviewer Review Type Date Requested Status
Server Team CI bot continuous-integration Approve
Ryan Harper Approve
Joshua Powers (community) Approve
Review via email: mp+347060@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.
It identifed some unused variables that version 1.6.0 did not identify.
The change here merely fixes those unused variables.

Description of the change

see commit message

To post a comment you must log in.
Revision history for this message
Joshua Powers (powersj) :
review: Approve
Revision history for this message
Ryan Harper (raharper) :
review: Approve
Revision history for this message
Server Team CI bot (server-team-bot) wrote :

PASSED: Continuous integration, rev:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/43/
Executed test runs:
    SUCCESS: Checkout
    SUCCESS: Unit & Style Tests
    SUCCESS: Ubuntu LTS: Build
    SUCCESS: Ubuntu LTS: Integration
    SUCCESS: MAAS Compatability Testing
    IN_PROGRESS: Declarative: Post Actions

Click here to trigger a rebuild:
https://jenkins.ubuntu.com/server/job/cloud-init-ci/43/rebuild

review: Approve (continuous-integration)
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/cloud-init/commit/?id=4ba4639b

There was an error fetching revisions from git servers. Please try again in a few minutes. If the problem persists, contact Launchpad support.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
diff --git a/cloudinit/config/cc_mounts.py b/cloudinit/config/cc_mounts.py
index eca6ea3..339baba 100644
--- a/cloudinit/config/cc_mounts.py
+++ b/cloudinit/config/cc_mounts.py
@@ -233,7 +233,7 @@ def setup_swapfile(fname, size=None, maxsize=None):
233 if str(size).lower() == "auto":233 if str(size).lower() == "auto":
234 try:234 try:
235 memsize = util.read_meminfo()['total']235 memsize = util.read_meminfo()['total']
236 except IOError as e:236 except IOError:
237 LOG.debug("Not creating swap: failed to read meminfo")237 LOG.debug("Not creating swap: failed to read meminfo")
238 return238 return
239239
diff --git a/cloudinit/handlers/upstart_job.py b/cloudinit/handlers/upstart_job.py
index 1ca92d4..dc33876 100644
--- a/cloudinit/handlers/upstart_job.py
+++ b/cloudinit/handlers/upstart_job.py
@@ -97,7 +97,7 @@ def _has_suitable_upstart():
97 else:97 else:
98 util.logexc(LOG, "dpkg --compare-versions failed [%s]",98 util.logexc(LOG, "dpkg --compare-versions failed [%s]",
99 e.exit_code)99 e.exit_code)
100 except Exception as e:100 except Exception:
101 util.logexc(LOG, "dpkg --compare-versions failed")101 util.logexc(LOG, "dpkg --compare-versions failed")
102 return False102 return False
103 else:103 else:
diff --git a/cloudinit/sources/DataSourceAltCloud.py b/cloudinit/sources/DataSourceAltCloud.py
index f6e86f3..24fd65f 100644
--- a/cloudinit/sources/DataSourceAltCloud.py
+++ b/cloudinit/sources/DataSourceAltCloud.py
@@ -184,11 +184,11 @@ class DataSourceAltCloud(sources.DataSource):
184 cmd = CMD_PROBE_FLOPPY184 cmd = CMD_PROBE_FLOPPY
185 (cmd_out, _err) = util.subp(cmd)185 (cmd_out, _err) = util.subp(cmd)
186 LOG.debug('Command: %s\nOutput%s', ' '.join(cmd), cmd_out)186 LOG.debug('Command: %s\nOutput%s', ' '.join(cmd), cmd_out)
187 except ProcessExecutionError as _err:187 except ProcessExecutionError as e:
188 util.logexc(LOG, 'Failed command: %s\n%s', ' '.join(cmd), _err)188 util.logexc(LOG, 'Failed command: %s\n%s', ' '.join(cmd), e)
189 return False189 return False
190 except OSError as _err:190 except OSError as e:
191 util.logexc(LOG, 'Failed command: %s\n%s', ' '.join(cmd), _err)191 util.logexc(LOG, 'Failed command: %s\n%s', ' '.join(cmd), e)
192 return False192 return False
193193
194 floppy_dev = '/dev/fd0'194 floppy_dev = '/dev/fd0'
@@ -197,11 +197,11 @@ class DataSourceAltCloud(sources.DataSource):
197 try:197 try:
198 (cmd_out, _err) = util.udevadm_settle(exists=floppy_dev, timeout=5)198 (cmd_out, _err) = util.udevadm_settle(exists=floppy_dev, timeout=5)
199 LOG.debug('Command: %s\nOutput%s', ' '.join(cmd), cmd_out)199 LOG.debug('Command: %s\nOutput%s', ' '.join(cmd), cmd_out)
200 except ProcessExecutionError as _err:200 except ProcessExecutionError as e:
201 util.logexc(LOG, 'Failed command: %s\n%s', ' '.join(cmd), _err)201 util.logexc(LOG, 'Failed command: %s\n%s', ' '.join(cmd), e)
202 return False202 return False
203 except OSError as _err:203 except OSError as e:
204 util.logexc(LOG, 'Failed command: %s\n%s', ' '.join(cmd), _err)204 util.logexc(LOG, 'Failed command: %s\n%s', ' '.join(cmd), e)
205 return False205 return False
206206
207 try:207 try:
diff --git a/cloudinit/sources/DataSourceNoCloud.py b/cloudinit/sources/DataSourceNoCloud.py
index 5d3a8dd..2daea59 100644
--- a/cloudinit/sources/DataSourceNoCloud.py
+++ b/cloudinit/sources/DataSourceNoCloud.py
@@ -78,7 +78,7 @@ class DataSourceNoCloud(sources.DataSource):
78 LOG.debug("Using seeded data from %s", path)78 LOG.debug("Using seeded data from %s", path)
79 mydata = _merge_new_seed(mydata, seeded)79 mydata = _merge_new_seed(mydata, seeded)
80 break80 break
81 except ValueError as e:81 except ValueError:
82 pass82 pass
8383
84 # If the datasource config had a 'seedfrom' entry, then that takes84 # If the datasource config had a 'seedfrom' entry, then that takes
@@ -117,7 +117,7 @@ class DataSourceNoCloud(sources.DataSource):
117 try:117 try:
118 seeded = util.mount_cb(dev, _pp2d_callback,118 seeded = util.mount_cb(dev, _pp2d_callback,
119 pp2d_kwargs)119 pp2d_kwargs)
120 except ValueError as e:120 except ValueError:
121 if dev in label_list:121 if dev in label_list:
122 LOG.warning("device %s with label=%s not a"122 LOG.warning("device %s with label=%s not a"
123 "valid seed.", dev, label)123 "valid seed.", dev, label)
diff --git a/cloudinit/sources/DataSourceOpenNebula.py b/cloudinit/sources/DataSourceOpenNebula.py
index d4a4111..16c1078 100644
--- a/cloudinit/sources/DataSourceOpenNebula.py
+++ b/cloudinit/sources/DataSourceOpenNebula.py
@@ -378,7 +378,7 @@ def read_context_disk_dir(source_dir, asuser=None):
378 if asuser is not None:378 if asuser is not None:
379 try:379 try:
380 pwd.getpwnam(asuser)380 pwd.getpwnam(asuser)
381 except KeyError as e:381 except KeyError:
382 raise BrokenContextDiskDir(382 raise BrokenContextDiskDir(
383 "configured user '{user}' does not exist".format(383 "configured user '{user}' does not exist".format(
384 user=asuser))384 user=asuser))
diff --git a/cloudinit/util.py b/cloudinit/util.py
index c0473b8..6ea6ca7 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -2531,8 +2531,8 @@ def _call_dmidecode(key, dmidecode_path):
2531 if result.replace(".", "") == "":2531 if result.replace(".", "") == "":
2532 return ""2532 return ""
2533 return result2533 return result
2534 except (IOError, OSError) as _err:2534 except (IOError, OSError) as e:
2535 LOG.debug('failed dmidecode cmd: %s\n%s', cmd, _err)2535 LOG.debug('failed dmidecode cmd: %s\n%s', cmd, e)
2536 return None2536 return None
25372537
25382538

Subscribers

People subscribed via source and target branches