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(): ...@@ -443,15 +443,15 @@ def main():
dirs = [(constants.RUN_GANETI_DIR, constants.RUN_DIRS_MODE), dirs = [(constants.RUN_GANETI_DIR, constants.RUN_DIRS_MODE),
(constants.SOCKET_DIR, constants.SOCKET_DIR_MODE), (constants.SOCKET_DIR, constants.SOCKET_DIR_MODE),
] ]
for dir, mode in dirs: for dir_name, mode in dirs:
try: try:
os.mkdir(dir, mode) os.mkdir(dir_name, mode)
except EnvironmentError, err: except EnvironmentError, err:
if err.errno != errno.EEXIST: if err.errno != errno.EEXIST:
raise errors.GenericError("Cannot create needed directory" raise errors.GenericError("Cannot create needed directory"
" '%s': %s" % (constants.SOCKET_DIR, err)) " '%s': %s" % (constants.SOCKET_DIR, err))
if not os.path.isdir(dir): if not os.path.isdir(dir_name):
raise errors.GenericError("%s is not a directory" % dir) raise errors.GenericError("%s is not a directory" % dir_name)
# This is safe to do as the pid file guarantees against # This is safe to do as the pid file guarantees against
# concurrent execution. # concurrent execution.
......
...@@ -435,7 +435,7 @@ def VerifyNode(what, cluster_name): ...@@ -435,7 +435,7 @@ def VerifyNode(what, cluster_name):
if constants.NV_DRBDLIST in what: if constants.NV_DRBDLIST in what:
try: try:
used_minors = bdev.DRBD8.GetUsedDevs().keys() used_minors = bdev.DRBD8.GetUsedDevs().keys()
except errors.BlockDeviceErrors: except errors.BlockDeviceError:
logging.warning("Can't get used minors list", exc_info=True) logging.warning("Can't get used minors list", exc_info=True)
used_minors = [] used_minors = []
result[constants.NV_DRBDLIST] = used_minors result[constants.NV_DRBDLIST] = used_minors
......
...@@ -293,9 +293,8 @@ class XenHypervisor(hv_base.BaseHypervisor): ...@@ -293,9 +293,8 @@ class XenHypervisor(hv_base.BaseHypervisor):
# remove old xen file after migration succeeded # remove old xen file after migration succeeded
try: try:
self._RemoveConfigFile(instance) self._RemoveConfigFile(instance)
except EnvironmentError, err: except EnvironmentError:
logger.Error("Failure while removing instance config file: %s" % logging.exception("Failure while removing instance config file")
str(err))
class XenPvmHypervisor(XenHypervisor): 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