From 98975cac7b2d4bf82428cb94caff982c7e2d4105 Mon Sep 17 00:00:00 2001 From: Carlos Meza Date: Sun, 18 Feb 2018 20:28:37 -0800 Subject: [PATCH] pylint unidiomatic-typecheck --- bootstrapvz/common/tasks/logicalvolume.py | 2 +- bootstrapvz/common/tasks/loopback.py | 2 +- bootstrapvz/common/tools.py | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/bootstrapvz/common/tasks/logicalvolume.py b/bootstrapvz/common/tasks/logicalvolume.py index 2092ea0..f5d4566 100644 --- a/bootstrapvz/common/tasks/logicalvolume.py +++ b/bootstrapvz/common/tasks/logicalvolume.py @@ -12,7 +12,7 @@ class AddRequiredCommands(Task): @classmethod def run(cls, info): from bootstrapvz.common.fs.logicalvolume import LogicalVolume - if type(info.volume) is LogicalVolume: + if isinstance(info.volume, LogicalVolume): info.host_dependencies['lvcreate'] = 'lvm2' info.host_dependencies['losetup'] = 'mount' diff --git a/bootstrapvz/common/tasks/loopback.py b/bootstrapvz/common/tasks/loopback.py index 0de1764..25d4179 100644 --- a/bootstrapvz/common/tasks/loopback.py +++ b/bootstrapvz/common/tasks/loopback.py @@ -13,7 +13,7 @@ class AddRequiredCommands(Task): def run(cls, info): from ..fs.loopbackvolume import LoopbackVolume from ..fs.qemuvolume import QEMUVolume - if type(info.volume) is LoopbackVolume: + if isinstance(info.volume, LoopbackVolume): info.host_dependencies['losetup'] = 'mount' info.host_dependencies['truncate'] = 'coreutils' if isinstance(info.volume, QEMUVolume): diff --git a/bootstrapvz/common/tools.py b/bootstrapvz/common/tools.py index a80c8c6..e935a15 100644 --- a/bootstrapvz/common/tools.py +++ b/bootstrapvz/common/tools.py @@ -22,7 +22,7 @@ def log_call(command, stdin=None, env=None, shell=False, cwd=None): command_log = realpath(command[0]).replace('/', '.') log = logging.getLogger(__name__ + command_log) - if type(command) is list: + if isinstance(command, list): log.debug('Executing: {command}'.format(command=' '.join(command))) else: log.debug('Executing: {command}'.format(command=command))