Commit c979d253 authored by Iustin Pop's avatar Iustin Pop
Browse files

Fix some more pylint errors

Two are real errors (invalid names) and one is style error (overriding
name from outer scope).

Reviewed-by: ultrotter
parent dc458d00
......@@ -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.
......
......@@ -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
......
......@@ -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):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment