summaryrefslogtreecommitdiff
path: root/cloudinit
diff options
context:
space:
mode:
authorParide Legovini <paride.legovini@canonical.com>2019-01-30 15:38:56 +0000
committerServer Team CI Bot <josh.powers+server-team-bot@canonical.com>2019-01-30 15:38:56 +0000
commit94a64529dccebd8fe8c7969370b8696e46023fbd (patch)
tree24028bb1e5f2ff24a4f605887381c14659f02a67 /cloudinit
parent8ee294d567c071fff1f9567e968ba73602308192 (diff)
downloadvyos-cloud-init-94a64529dccebd8fe8c7969370b8696e46023fbd.tar.gz
vyos-cloud-init-94a64529dccebd8fe8c7969370b8696e46023fbd.zip
Resolve flake8 comparison and pycodestyle over-ident issues
Fixes: - flake8: use ==/!= to compare str, bytes, and int literals - pycodestyle: E117 over-indented
Diffstat (limited to 'cloudinit')
-rw-r--r--cloudinit/config/schema.py2
-rw-r--r--cloudinit/handlers/upstart_job.py2
-rw-r--r--cloudinit/sources/DataSourceEc2.py2
-rw-r--r--cloudinit/stages.py4
-rw-r--r--cloudinit/url_helper.py2
5 files changed, 6 insertions, 6 deletions
diff --git a/cloudinit/config/schema.py b/cloudinit/config/schema.py
index 080a6d06..807c3eee 100644
--- a/cloudinit/config/schema.py
+++ b/cloudinit/config/schema.py
@@ -367,7 +367,7 @@ def handle_schema_args(name, args):
if not args.annotate:
error(str(e))
except RuntimeError as e:
- error(str(e))
+ error(str(e))
else:
print("Valid cloud-config file {0}".format(args.config_file))
if args.doc:
diff --git a/cloudinit/handlers/upstart_job.py b/cloudinit/handlers/upstart_job.py
index 83fb0724..003cad60 100644
--- a/cloudinit/handlers/upstart_job.py
+++ b/cloudinit/handlers/upstart_job.py
@@ -89,7 +89,7 @@ def _has_suitable_upstart():
util.subp(["dpkg", "--compare-versions", dpkg_ver, "ge", good])
return True
except util.ProcessExecutionError as e:
- if e.exit_code is 1:
+ if e.exit_code == 1:
pass
else:
util.logexc(LOG, "dpkg --compare-versions failed [%s]",
diff --git a/cloudinit/sources/DataSourceEc2.py b/cloudinit/sources/DataSourceEc2.py
index 9ccf2cdc..eb6f27b2 100644
--- a/cloudinit/sources/DataSourceEc2.py
+++ b/cloudinit/sources/DataSourceEc2.py
@@ -442,7 +442,7 @@ def identify_aws(data):
if (data['uuid'].startswith('ec2') and
(data['uuid_source'] == 'hypervisor' or
data['uuid'] == data['serial'])):
- return CloudNames.AWS
+ return CloudNames.AWS
return None
diff --git a/cloudinit/stages.py b/cloudinit/stages.py
index 8a064124..da7d349a 100644
--- a/cloudinit/stages.py
+++ b/cloudinit/stages.py
@@ -548,11 +548,11 @@ class Init(object):
with events.ReportEventStack("consume-user-data",
"reading and applying user-data",
parent=self.reporter):
- self._consume_userdata(frequency)
+ self._consume_userdata(frequency)
with events.ReportEventStack("consume-vendor-data",
"reading and applying vendor-data",
parent=self.reporter):
- self._consume_vendordata(frequency)
+ self._consume_vendordata(frequency)
# Perform post-consumption adjustments so that
# modules that run during the init stage reflect
diff --git a/cloudinit/url_helper.py b/cloudinit/url_helper.py
index 396d69ae..0af0d9e3 100644
--- a/cloudinit/url_helper.py
+++ b/cloudinit/url_helper.py
@@ -521,7 +521,7 @@ class OauthUrlHelper(object):
if extra_exception_cb:
ret = extra_exception_cb(msg, exception)
finally:
- self.exception_cb(msg, exception)
+ self.exception_cb(msg, exception)
return ret
def _headers_cb(self, extra_headers_cb, url):