From c979d253680db056f294270dc54b4018b1974a95 Mon Sep 17 00:00:00 2001 From: Iustin Pop <iustin@google.com> Date: Wed, 21 Jan 2009 14:12:35 +0000 Subject: [PATCH] Fix some more pylint errors Two are real errors (invalid names) and one is style error (overriding name from outer scope). Reviewed-by: ultrotter --- daemons/ganeti-masterd | 8 ++++---- lib/backend.py | 2 +- lib/hypervisor/hv_xen.py | 5 ++--- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/daemons/ganeti-masterd b/daemons/ganeti-masterd index 6dad3d29e..285bcbf21 100755 --- a/daemons/ganeti-masterd +++ b/daemons/ganeti-masterd @@ -443,15 +443,15 @@ def main(): dirs = [(constants.RUN_GANETI_DIR, constants.RUN_DIRS_MODE), (constants.SOCKET_DIR, constants.SOCKET_DIR_MODE), ] - for dir, mode in dirs: + for dir_name, mode in dirs: try: - os.mkdir(dir, mode) + os.mkdir(dir_name, mode) except EnvironmentError, err: if err.errno != errno.EEXIST: raise errors.GenericError("Cannot create needed directory" " '%s': %s" % (constants.SOCKET_DIR, err)) - if not os.path.isdir(dir): - raise errors.GenericError("%s is not a directory" % dir) + if not os.path.isdir(dir_name): + raise errors.GenericError("%s is not a directory" % dir_name) # This is safe to do as the pid file guarantees against # concurrent execution. diff --git a/lib/backend.py b/lib/backend.py index a1bc244b4..3a86cbbe5 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -435,7 +435,7 @@ def VerifyNode(what, cluster_name): if constants.NV_DRBDLIST in what: try: used_minors = bdev.DRBD8.GetUsedDevs().keys() - except errors.BlockDeviceErrors: + except errors.BlockDeviceError: logging.warning("Can't get used minors list", exc_info=True) used_minors = [] result[constants.NV_DRBDLIST] = used_minors diff --git a/lib/hypervisor/hv_xen.py b/lib/hypervisor/hv_xen.py index 6da7f1a2b..1bbb6117f 100644 --- a/lib/hypervisor/hv_xen.py +++ b/lib/hypervisor/hv_xen.py @@ -293,9 +293,8 @@ class XenHypervisor(hv_base.BaseHypervisor): # remove old xen file after migration succeeded try: self._RemoveConfigFile(instance) - except EnvironmentError, err: - logger.Error("Failure while removing instance config file: %s" % - str(err)) + except EnvironmentError: + logging.exception("Failure while removing instance config file") class XenPvmHypervisor(XenHypervisor): -- GitLab