From d86f9e94b5f7ea36f54af05c86c767fea0fcf485 Mon Sep 17 00:00:00 2001 From: Carlos Meza Date: Sun, 25 Feb 2018 06:31:03 +0000 Subject: [PATCH] pylint W0404(reimported) --- bootstrapvz/base/fs/volume.py | 5 +++-- bootstrapvz/common/tasks/apt.py | 1 - bootstrapvz/plugins/cloud_init/__init__.py | 1 - bootstrapvz/plugins/puppet/tasks.py | 2 -- 4 files changed, 3 insertions(+), 6 deletions(-) diff --git a/bootstrapvz/base/fs/volume.py b/bootstrapvz/base/fs/volume.py index d2f2013..a8e131c 100644 --- a/bootstrapvz/base/fs/volume.py +++ b/bootstrapvz/base/fs/volume.py @@ -82,7 +82,9 @@ class Volume(FSMProxy): :raises VolumeError: When a free block device cannot be found. """ import os.path + import string from bootstrapvz.common.fs import get_partitions + # Fetch information from /proc/partitions proc_partitions = get_partitions() device_name = os.path.basename(self.device_path) @@ -104,8 +106,7 @@ class Volume(FSMProxy): major=device_partition['major'], minor=device_partition['minor'], start_sec=start_sector)) - import string - import os.path + # Figure out the device letter and path for letter in string.ascii_lowercase: dev_name = 'vd' + letter diff --git a/bootstrapvz/common/tasks/apt.py b/bootstrapvz/common/tasks/apt.py index 0817b83..e7bf458 100644 --- a/bootstrapvz/common/tasks/apt.py +++ b/bootstrapvz/common/tasks/apt.py @@ -141,7 +141,6 @@ class WriteSources(Task): @classmethod def run(cls, info): if not info.source_lists.target_exists(info.manifest.system['release']): - import logging log = logging.getLogger(__name__) log.warn('No default target has been specified in the sources list, ' 'installing packages may fail') diff --git a/bootstrapvz/plugins/cloud_init/__init__.py b/bootstrapvz/plugins/cloud_init/__init__.py index 76458a8..7a4249d 100644 --- a/bootstrapvz/plugins/cloud_init/__init__.py +++ b/bootstrapvz/plugins/cloud_init/__init__.py @@ -4,7 +4,6 @@ assets = rel_path(__file__, 'assets') def validate_manifest(data, validator, error): - from bootstrapvz.common.tools import rel_path validator(data, rel_path(__file__, 'manifest-schema.yml')) diff --git a/bootstrapvz/plugins/puppet/tasks.py b/bootstrapvz/plugins/puppet/tasks.py index 70371f9..aedb312 100644 --- a/bootstrapvz/plugins/puppet/tasks.py +++ b/bootstrapvz/plugins/puppet/tasks.py @@ -19,7 +19,6 @@ class CheckRequestedDebianRelease(Task): @classmethod def run(cls, info): - from bootstrapvz.common.exceptions import TaskError if info.manifest.release not in (jessie, wheezy, stretch): msg = 'Debian {info.manifest.release} is not (yet) available in the Puppetlabs.com APT repository.' raise TaskError(msg) @@ -32,7 +31,6 @@ class CheckAssetsPath(Task): @classmethod def run(cls, info): - from bootstrapvz.common.exceptions import TaskError assets = info.manifest.plugins['puppet']['assets'] if not os.path.exists(assets): msg = 'The assets directory {assets} does not exist.'.format(assets=assets)