Commit 6f1da8b3 authored by Iustin Pop's avatar Iustin Pop
Browse files

Merge branch 'devel-2.6'



* devel-2.6:
  Fix warnings/errors with newer pylint
  Fix decorator uses which crash newer pylint
Signed-off-by: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarBernardo Dal Seno <bdalseno@google.com>
parents 2a9aff11 fa0003dc
......@@ -960,9 +960,8 @@ def _RunPostHook(lu, node_name):
hm = lu.proc.BuildHooksManager(lu)
try:
hm.RunPhase(constants.HOOKS_PHASE_POST, nodes=[node_name])
except:
# pylint: disable=W0702
lu.LogWarning("Errors occurred running hooks on %s" % node_name)
except Exception, err: # pylint: disable=W0703
lu.LogWarning("Errors occurred running hooks on %s: %s" % (node_name, err))
 
 
def _CheckOutputFields(static, dynamic, selected):
......
#
#
# Copyright (C) 2010 Google Inc.
# Copyright (C) 2010, 2011, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -280,8 +280,8 @@ def TcpPing(target, port, timeout=10, live_port_needed=False, source=None):
if source is not None:
try:
sock.bind((source, 0))
except socket.error, (errcode, _):
if errcode == errno.EADDRNOTAVAIL:
except socket.error, err:
if err[0] == errno.EADDRNOTAVAIL:
success = False
sock.settimeout(timeout)
......@@ -292,8 +292,8 @@ def TcpPing(target, port, timeout=10, live_port_needed=False, source=None):
success = True
except socket.timeout:
success = False
except socket.error, (errcode, _):
success = (not live_port_needed) and (errcode == errno.ECONNREFUSED)
except socket.error, err:
success = (not live_port_needed) and (err[0] == errno.ECONNREFUSED)
return success
......
......@@ -51,6 +51,7 @@ from ganeti import ssconf
from ganeti import ht
import ganeti.rapi.client # pylint: disable=W0611
from ganeti.rapi.client import UsesRapiClient
from ganeti.watcher import nodemaint
from ganeti.watcher import state
......@@ -569,7 +570,7 @@ def _CheckMaster(cl):
raise NotMasterError("This is not the master node")
@rapi.client.UsesRapiClient
@UsesRapiClient
def _GlobalWatcher(opts):
"""Main function for global watcher.
......
......@@ -45,10 +45,11 @@ import qa_tags
import qa_utils
from ganeti import utils
from ganeti import rapi
from ganeti import rapi # pylint: disable=W0611
from ganeti import constants
import ganeti.rapi.client # pylint: disable=W0611
from ganeti.rapi.client import UsesRapiClient
def _FormatHeader(line, end=72):
......@@ -574,7 +575,7 @@ def RunQa():
RunTestIf("cluster-destroy", qa_cluster.TestClusterDestroy)
@rapi.client.UsesRapiClient
@UsesRapiClient
def main():
"""Main program.
......
......@@ -80,7 +80,7 @@ def Validate():
def get(name, default=None):
return cfg.get(name, default)
return cfg.get(name, default) # pylint: disable=E1103
class Either:
......@@ -149,7 +149,7 @@ def TestEnabled(tests, _cfg=None):
_cfg = cfg
# Get settings for all tests
cfg_tests = _cfg.get("tests", {})
cfg_tests = _cfg.get("tests", {}) # pylint: disable=E1103
# Get default setting
default = cfg_tests.get("default", True)
......@@ -162,7 +162,7 @@ def GetInstanceCheckScript():
"""Returns path to instance check script or C{None}.
"""
return cfg.get(_INSTANCE_CHECK_KEY, None)
return cfg.get(_INSTANCE_CHECK_KEY, None) # pylint: disable=E1103
def GetEnabledHypervisors():
......
#!/usr/bin/python
#
# Copyright (C) 2010 Google Inc.
# Copyright (C) 2010, 2011, 2012 Google Inc.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -42,6 +42,7 @@ from ganeti import rapi
import ganeti.rapi.client # pylint: disable=W0611
import ganeti.rapi.client_utils
from ganeti.rapi.client import UsesRapiClient
SRC_RAPI_PORT_OPT = \
......@@ -836,7 +837,7 @@ def CheckOptions(parser, options, args):
return (src_cluster_name, dest_cluster_name, instance_names)
@rapi.client.UsesRapiClient
@UsesRapiClient
def main():
"""Main routine.
......
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