summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2015-05-01 05:38:56 -0400
committerScott Moser <smoser@ubuntu.com>2015-05-01 05:38:56 -0400
commit96854d720d4bd356181acfa093744599a807ea8e (patch)
tree8617f48d840137d94bed1958da4ebef7587e2bca
parent5ab9a1349db2286fca96681e00480d04bfd4473d (diff)
downloadvyos-cloud-init-96854d720d4bd356181acfa093744599a807ea8e.tar.gz
vyos-cloud-init-96854d720d4bd356181acfa093744599a807ea8e.zip
fix 'Make pyflakes'
-rw-r--r--Makefile2
-rw-r--r--cloudinit/config/cc_apt_pipelining.py2
-rw-r--r--cloudinit/config/cc_snappy.py2
-rw-r--r--cloudinit/sources/DataSourceOpenNebula.py1
-rw-r--r--tests/unittests/test_datasource/test_smartos.py2
-rw-r--r--tests/unittests/test_handler/test_handler_apt_configure.py1
-rw-r--r--tests/unittests/test_handler/test_handler_snappy.py5
-rw-r--r--tests/unittests/test_templating.py5
-rwxr-xr-xtools/hacking.py2
-rwxr-xr-xtools/validate-yaml.py3
10 files changed, 5 insertions, 20 deletions
diff --git a/Makefile b/Makefile
index 009257ca..bb0c5253 100644
--- a/Makefile
+++ b/Makefile
@@ -20,7 +20,7 @@ pep8:
@$(CWD)/tools/run-pep8 $(PY_FILES)
pyflakes:
- pyflakes $(PY_FILES)
+ @$(CWD)/tools/tox-venv py34 pyflakes $(PY_FILES)
pip-requirements:
@echo "Installing cloud-init dependencies..."
diff --git a/cloudinit/config/cc_apt_pipelining.py b/cloudinit/config/cc_apt_pipelining.py
index e5629175..40c32c84 100644
--- a/cloudinit/config/cc_apt_pipelining.py
+++ b/cloudinit/config/cc_apt_pipelining.py
@@ -43,7 +43,7 @@ def handle(_name, cfg, _cloud, log, _args):
write_apt_snippet("0", log, DEFAULT_FILE)
elif apt_pipe_value_s in ("none", "unchanged", "os"):
return
- elif apt_pipe_value_s in [str(b) for b in xrange(0, 6)]:
+ elif apt_pipe_value_s in [str(b) for b in range(0, 6)]:
write_apt_snippet(apt_pipe_value_s, log, DEFAULT_FILE)
else:
log.warn("Invalid option for apt_pipeling: %s", apt_pipe_value)
diff --git a/cloudinit/config/cc_snappy.py b/cloudinit/config/cc_snappy.py
index bfe76558..7aaec94a 100644
--- a/cloudinit/config/cc_snappy.py
+++ b/cloudinit/config/cc_snappy.py
@@ -42,12 +42,10 @@ Example config:
"""
from cloudinit import log as logging
-from cloudinit import templater
from cloudinit import util
from cloudinit.settings import PER_INSTANCE
import glob
-import six
import tempfile
import os
diff --git a/cloudinit/sources/DataSourceOpenNebula.py b/cloudinit/sources/DataSourceOpenNebula.py
index 61709c1b..ac2c3b45 100644
--- a/cloudinit/sources/DataSourceOpenNebula.py
+++ b/cloudinit/sources/DataSourceOpenNebula.py
@@ -24,7 +24,6 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-import base64
import os
import pwd
import re
diff --git a/tests/unittests/test_datasource/test_smartos.py b/tests/unittests/test_datasource/test_smartos.py
index 28b41eaf..adee9019 100644
--- a/tests/unittests/test_datasource/test_smartos.py
+++ b/tests/unittests/test_datasource/test_smartos.py
@@ -36,8 +36,6 @@ from binascii import crc32
import serial
import six
-import six
-
from cloudinit import helpers as c_helpers
from cloudinit.sources import DataSourceSmartOS
from cloudinit.util import b64e
diff --git a/tests/unittests/test_handler/test_handler_apt_configure.py b/tests/unittests/test_handler/test_handler_apt_configure.py
index 02cad8b2..895728b3 100644
--- a/tests/unittests/test_handler/test_handler_apt_configure.py
+++ b/tests/unittests/test_handler/test_handler_apt_configure.py
@@ -7,7 +7,6 @@ import os
import re
import shutil
import tempfile
-import unittest
class TestAptProxyConfig(TestCase):
diff --git a/tests/unittests/test_handler/test_handler_snappy.py b/tests/unittests/test_handler/test_handler_snappy.py
index f3109bac..eceb14d9 100644
--- a/tests/unittests/test_handler/test_handler_snappy.py
+++ b/tests/unittests/test_handler/test_handler_snappy.py
@@ -38,7 +38,6 @@ class TestInstallPackages(t_help.TestCase):
if 'args' not in kwargs:
kwargs['args'] = args[0]
self.subp_called.append(kwargs)
- snap_cmds = []
args = kwargs['args']
# here we basically parse the snappy command invoked
# and append to snapcmds a list of (mode, pkg, config)
@@ -117,9 +116,6 @@ class TestInstallPackages(t_help.TestCase):
def test_package_ops_common_filename(self):
# fish package name from filename
# package names likely look like: pkgname.namespace_version_arch.snap
- fname = "xkcd-webserver.canonical_0.3.4_all.snap"
- name = "xkcd-webserver.canonical"
- shortname = "xkcd-webserver"
# find filenames
self.populate_tmp(
@@ -165,7 +161,6 @@ class TestInstallPackages(t_help.TestCase):
'ubuntu-core': {'c1': 'c2'},
'notinstalled.smoser': {'s1': 's2'},
}
- cfg = {'config-example-k1': 'config-example-k2'}
ret = get_package_ops(
packages=['config-example.canonical'], configs=cfgs,
installed=['config-example.smoser', 'pkg1.canonical',
diff --git a/tests/unittests/test_templating.py b/tests/unittests/test_templating.py
index cf7c03b0..0c19a2c2 100644
--- a/tests/unittests/test_templating.py
+++ b/tests/unittests/test_templating.py
@@ -18,10 +18,6 @@
from __future__ import print_function
-import sys
-import six
-import unittest
-
from . import helpers as test_helpers
import textwrap
@@ -30,6 +26,7 @@ from cloudinit import templater
try:
import Cheetah
HAS_CHEETAH = True
+ Cheetah # make pyflakes happy, as Cheetah is not used here
except ImportError:
HAS_CHEETAH = False
diff --git a/tools/hacking.py b/tools/hacking.py
index e7797564..3175df38 100755
--- a/tools/hacking.py
+++ b/tools/hacking.py
@@ -128,7 +128,7 @@ def cloud_docstring_multiline_end(physical_line):
"""
pos = max([physical_line.find(i) for i in DOCSTRING_TRIPLE]) # start
if (pos != -1 and len(physical_line) == pos):
- print physical_line
+ print(physical_line)
if (physical_line[pos + 3] == ' '):
return (pos, "N403: multi line docstring end on new line")
diff --git a/tools/validate-yaml.py b/tools/validate-yaml.py
index eda59cb8..6e164590 100755
--- a/tools/validate-yaml.py
+++ b/tools/validate-yaml.py
@@ -4,7 +4,6 @@
"""
import sys
-
import yaml
@@ -17,7 +16,7 @@ if __name__ == "__main__":
yaml.safe_load(fh.read())
fh.close()
sys.stdout.write(" - ok\n")
- except Exception, e:
+ except Exception as e:
sys.stdout.write(" - bad (%s)\n" % (e))
bads += 1
if bads > 0: