summaryrefslogtreecommitdiff
path: root/tests/cloud_tests/setup_image.py
diff options
context:
space:
mode:
authorScott Moser <smoser@ubuntu.com>2018-04-19 21:30:08 -0600
committerChad Smith <chad.smith@canonical.com>2018-04-19 21:30:08 -0600
commit1081962eacf2814fea6f4fa3255c530de14e4a24 (patch)
tree5025c02d1215a9c0716c28499f1a9c3ee4c3e35b /tests/cloud_tests/setup_image.py
parent53f3f551f8e5d3d86c428bc51161a7842dfe06f9 (diff)
downloadvyos-cloud-init-1081962eacf2814fea6f4fa3255c530de14e4a24.tar.gz
vyos-cloud-init-1081962eacf2814fea6f4fa3255c530de14e4a24.zip
pylint: pay attention to unused variable warnings.
This enables warnings produced by pylint for unused variables (W0612), and fixes the existing errors.
Diffstat (limited to 'tests/cloud_tests/setup_image.py')
-rw-r--r--tests/cloud_tests/setup_image.py11
1 files changed, 5 insertions, 6 deletions
diff --git a/tests/cloud_tests/setup_image.py b/tests/cloud_tests/setup_image.py
index 6d242115..4e195709 100644
--- a/tests/cloud_tests/setup_image.py
+++ b/tests/cloud_tests/setup_image.py
@@ -25,10 +25,9 @@ def installed_package_version(image, package, ensure_installed=True):
else:
raise NotImplementedError
- msg = 'query version for package: {}'.format(package)
- (out, err, exit) = image.execute(
- cmd, description=msg, rcs=(0,) if ensure_installed else range(0, 256))
- return out.strip()
+ return image.execute(
+ cmd, description='query version for package: {}'.format(package),
+ rcs=(0,) if ensure_installed else range(0, 256))[0].strip()
def install_deb(args, image):
@@ -54,7 +53,7 @@ def install_deb(args, image):
remote_path], description=msg)
# check installed deb version matches package
fmt = ['-W', "--showformat=${Version}"]
- (out, err, exit) = image.execute(['dpkg-deb'] + fmt + [remote_path])
+ out = image.execute(['dpkg-deb'] + fmt + [remote_path])[0]
expected_version = out.strip()
found_version = installed_package_version(image, 'cloud-init')
if expected_version != found_version:
@@ -85,7 +84,7 @@ def install_rpm(args, image):
image.execute(['rpm', '-U', remote_path], description=msg)
fmt = ['--queryformat', '"%{VERSION}"']
- (out, err, exit) = image.execute(['rpm', '-q'] + fmt + [remote_path])
+ (out, _err, _exit) = image.execute(['rpm', '-q'] + fmt + [remote_path])
expected_version = out.strip()
found_version = installed_package_version(image, 'cloud-init')
if expected_version != found_version: