summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cloudinit/distros/freebsd.py3
-rw-r--r--cloudinit/distros/net_util.py1
-rw-r--r--cloudinit/distros/rhel.py2
-rw-r--r--cloudinit/sources/DataSourceConfigDrive.py4
-rw-r--r--cloudinit/sources/DataSourceDigitalOcean.py11
-rw-r--r--cloudinit/util.py2
-rw-r--r--doc/rtd/conf.py6
-rwxr-xr-xsetup.py2
-rw-r--r--tests/unittests/test_datasource/test_digitalocean.py1
-rw-r--r--tests/unittests/test_datasource/test_gce.py3
-rw-r--r--tests/unittests/test_datasource/test_smartos.py4
-rw-r--r--tests/unittests/test_distros/test_netconfig.py2
-rw-r--r--tests/unittests/test_handler/test_handler_yum_add_repo.py2
-rw-r--r--tests/unittests/test_templating.py3
-rwxr-xr-xtools/run-pep81
15 files changed, 25 insertions, 22 deletions
diff --git a/cloudinit/distros/freebsd.py b/cloudinit/distros/freebsd.py
index ee23fd20..9216510e 100644
--- a/cloudinit/distros/freebsd.py
+++ b/cloudinit/distros/freebsd.py
@@ -119,7 +119,8 @@ class Distro(distros.Distro):
index = n.group(0)
(out, err) = util.subp(['ifconfig', '-a'])
- ifconfigoutput = [x for x in (out.strip()).splitlines() if len(x.split()) > 0]
+ ifconfigoutput = [x for x in (out.strip()).splitlines()
+ if len(x.split()) > 0]
for line in ifconfigoutput:
m = re.match('^\w+', line)
if m:
diff --git a/cloudinit/distros/net_util.py b/cloudinit/distros/net_util.py
index dd63a6a3..8b28e2d1 100644
--- a/cloudinit/distros/net_util.py
+++ b/cloudinit/distros/net_util.py
@@ -180,4 +180,3 @@ def translate_network(settings):
if cmd == 'iface' and 'inet6' in args:
real_ifaces[dev_name]['inet6'] = True
return real_ifaces
-
diff --git a/cloudinit/distros/rhel.py b/cloudinit/distros/rhel.py
index d5cc15fe..d9588632 100644
--- a/cloudinit/distros/rhel.py
+++ b/cloudinit/distros/rhel.py
@@ -91,7 +91,7 @@ class Distro(distros.Distro):
'IPV6INIT': _make_sysconfig_bool(True),
'IPV6ADDR': info.get('ipv6').get('address'),
'IPV6_DEFAULTGW': info.get('ipv6').get('gateway'),
- })
+ })
rhel_util.update_sysconfig_file(net_fn, net_cfg)
if 'dns-nameservers' in info:
nameservers.extend(info['dns-nameservers'])
diff --git a/cloudinit/sources/DataSourceConfigDrive.py b/cloudinit/sources/DataSourceConfigDrive.py
index 27658073..15244a0d 100644
--- a/cloudinit/sources/DataSourceConfigDrive.py
+++ b/cloudinit/sources/DataSourceConfigDrive.py
@@ -79,8 +79,8 @@ class DataSourceConfigDrive(openstack.SourceMixin, sources.DataSource):
else:
mtype = None
sync = True
- results = util.mount_cb(dev, read_config_drive, mtype=mtype,
- sync=sync)
+ results = util.mount_cb(dev, read_config_drive,
+ mtype=mtype, sync=sync)
found = dev
except openstack.NonReadable:
pass
diff --git a/cloudinit/sources/DataSourceDigitalOcean.py b/cloudinit/sources/DataSourceDigitalOcean.py
index 069bdb41..8f27ee89 100644
--- a/cloudinit/sources/DataSourceDigitalOcean.py
+++ b/cloudinit/sources/DataSourceDigitalOcean.py
@@ -31,6 +31,7 @@ BUILTIN_DS_CONFIG = {
MD_RETRIES = 0
MD_TIMEOUT = 1
+
class DataSourceDigitalOcean(sources.DataSource):
def __init__(self, sys_cfg, distro, paths):
sources.DataSource.__init__(self, sys_cfg, distro, paths)
@@ -51,10 +52,10 @@ class DataSourceDigitalOcean(sources.DataSource):
self.timeout = MD_TIMEOUT
def get_data(self):
- caller = functools.partial(util.read_file_or_url, timeout=self.timeout,
- retries=self.retries)
+ caller = functools.partial(util.read_file_or_url,
+ timeout=self.timeout, retries=self.retries)
md = ec2_utils.MetadataMaterializer(str(caller(self.metadata_address)),
- base_url=self.metadata_address,
+ base_url=self.metadata_address,
caller=caller)
self.metadata = md.materialize()
@@ -72,9 +73,9 @@ class DataSourceDigitalOcean(sources.DataSource):
def get_public_ssh_keys(self):
if type(self.metadata['public-keys']) is StringType:
- return [self.metadata['public-keys']]
+ return [self.metadata['public-keys']]
else:
- return self.metadata['public-keys']
+ return self.metadata['public-keys']
@property
def availability_zone(self):
diff --git a/cloudinit/util.py b/cloudinit/util.py
index ee5e5c0a..bf8e7d80 100644
--- a/cloudinit/util.py
+++ b/cloudinit/util.py
@@ -1966,7 +1966,7 @@ def pathprefix2dict(base, required=None, optional=None, delim=os.path.sep):
def read_meminfo(meminfo="/proc/meminfo", raw=False):
# read a /proc/meminfo style file and return
# a dict with 'total', 'free', and 'available'
- mpliers = {'kB': 2**10, 'mB': 2 ** 20, 'B': 1, 'gB': 2 ** 30}
+ mpliers = {'kB': 2 ** 10, 'mB': 2 ** 20, 'B': 1, 'gB': 2 ** 30}
kmap = {'MemTotal:': 'total', 'MemFree:': 'free',
'MemAvailable:': 'available'}
ret = {}
diff --git a/doc/rtd/conf.py b/doc/rtd/conf.py
index 9be02766..d3764bea 100644
--- a/doc/rtd/conf.py
+++ b/doc/rtd/conf.py
@@ -12,8 +12,8 @@ sys.path.insert(0, os.path.abspath('.'))
from cloudinit import version
# Supress warnings for docs that aren't used yet
-#unused_docs = [
-#]
+# unused_docs = [
+# ]
# General information about the project.
project = 'Cloud-Init'
@@ -21,7 +21,7 @@ project = 'Cloud-Init'
# -- General configuration ----------------------------------------------------
# If your documentation needs a minimal Sphinx version, state it here.
-#needs_sphinx = '1.0'
+# needs_sphinx = '1.0'
# Add any Sphinx extension module names here, as strings. They can be
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
diff --git a/setup.py b/setup.py
index ab72ec18..25f09e58 100755
--- a/setup.py
+++ b/setup.py
@@ -164,7 +164,7 @@ else:
(USR + '/share/doc/cloud-init', [f for f in glob('doc/*') if is_f(f)]),
(USR + '/share/doc/cloud-init/examples',
[f for f in glob('doc/examples/*') if is_f(f)]),
- (USR + '/share/doc/cloud-init/examples/seed',
+ (USR + '/share/doc/cloud-init/examples/seed',
[f for f in glob('doc/examples/seed/*') if is_f(f)]),
]
# Use a subclass for install that handles
diff --git a/tests/unittests/test_datasource/test_digitalocean.py b/tests/unittests/test_datasource/test_digitalocean.py
index 04bee340..d1270fc2 100644
--- a/tests/unittests/test_datasource/test_digitalocean.py
+++ b/tests/unittests/test_datasource/test_digitalocean.py
@@ -51,6 +51,7 @@ DO_META = {
MD_URL_RE = re.compile(r'http://169.254.169.254/metadata/v1/.*')
+
def _request_callback(method, uri, headers):
url_path = urlparse(uri).path
if url_path.startswith('/metadata/v1/'):
diff --git a/tests/unittests/test_datasource/test_gce.py b/tests/unittests/test_datasource/test_gce.py
index 60a0ce48..842a72ba 100644
--- a/tests/unittests/test_datasource/test_gce.py
+++ b/tests/unittests/test_datasource/test_gce.py
@@ -40,7 +40,8 @@ GCE_META_PARTIAL = {
}
HEADERS = {'X-Google-Metadata-Request': 'True'}
-MD_URL_RE = re.compile(r'http://metadata.google.internal./computeMetadata/v1/.*')
+MD_URL_RE = re.compile(
+ r'http://metadata.google.internal./computeMetadata/v1/.*')
def _request_callback(method, uri, headers):
diff --git a/tests/unittests/test_datasource/test_smartos.py b/tests/unittests/test_datasource/test_smartos.py
index b197b600..65675106 100644
--- a/tests/unittests/test_datasource/test_smartos.py
+++ b/tests/unittests/test_datasource/test_smartos.py
@@ -342,8 +342,8 @@ class TestSmartOSDataSource(helpers.FilesystemMockingTestCase):
"""
User-data in the SmartOS world is supposed to be written to a file
each and every boot. This tests to make sure that in the event the
- legacy user-data is removed, the existing user-data is backed-up and
- there is no /var/db/user-data left.
+ legacy user-data is removed, the existing user-data is backed-up
+ and there is no /var/db/user-data left.
"""
user_data_f = "%s/mdata-user-data" % self.legacy_user_d
diff --git a/tests/unittests/test_distros/test_netconfig.py b/tests/unittests/test_distros/test_netconfig.py
index dbbf9617..193338e8 100644
--- a/tests/unittests/test_distros/test_netconfig.py
+++ b/tests/unittests/test_distros/test_netconfig.py
@@ -294,7 +294,6 @@ IPV6_AUTOCONF=no
self.assertCfgEquals(expected_buf, str(write_buf))
self.assertEquals(write_buf.mode, 0644)
-
def test_simple_write_freebsd(self):
fbsd_distro = self._get_distro('freebsd')
util_mock = self.mocker.replace(util.write_file,
@@ -357,4 +356,3 @@ defaultrouter="192.168.1.254"
'''
self.assertCfgEquals(expected_buf, str(write_buf))
self.assertEquals(write_buf.mode, 0644)
-
diff --git a/tests/unittests/test_handler/test_handler_yum_add_repo.py b/tests/unittests/test_handler/test_handler_yum_add_repo.py
index 21b89c34..435c9787 100644
--- a/tests/unittests/test_handler/test_handler_yum_add_repo.py
+++ b/tests/unittests/test_handler/test_handler_yum_add_repo.py
@@ -24,7 +24,7 @@ class TestConfig(helpers.FilesystemMockingTestCase):
'epel-testing': {
'name': 'Extra Packages for Enterprise Linux 5 - Testing',
# Missing this should cause the repo not to be written
- # 'baseurl': 'http://blah.org/pub/epel/testing/5/$basearch',
+ # 'baseurl': 'http://blah.org/pub/epel/testing/5/$barch',
'enabled': False,
'gpgcheck': True,
'gpgkey': 'file:///etc/pki/rpm-gpg/RPM-GPG-KEY-EPEL',
diff --git a/tests/unittests/test_templating.py b/tests/unittests/test_templating.py
index 87681f0f..3ba4ed8a 100644
--- a/tests/unittests/test_templating.py
+++ b/tests/unittests/test_templating.py
@@ -100,7 +100,8 @@ $a,$b'''
mirror = "mymirror"
codename = "zany"
in_data = "deb $mirror $codename-updates main contrib non-free"
- ex_data = "deb %s %s-updates main contrib non-free" % (mirror, codename)
+ ex_data = "deb %s %s-updates main contrib non-free" % (mirror,
+ codename)
out_data = templater.basic_render(in_data,
{'mirror': mirror, 'codename': codename})
diff --git a/tools/run-pep8 b/tools/run-pep8
index d0a131f6..ccd6be5a 100755
--- a/tools/run-pep8
+++ b/tools/run-pep8
@@ -24,6 +24,7 @@ IGNORE="$IGNORE,E126" # Continuation line over-indented for hanging indent
IGNORE="$IGNORE,E127" # Continuation line over-indented for visual indent
IGNORE="$IGNORE,E128" # Continuation line under-indented for visual indent
IGNORE="$IGNORE,E502" # The backslash is redundant between brackets
+IGNORE="${IGNORE#,}" # remove the leading ',' added above
cmd=(
${base}/hacking.py