Revision b459a848
b/autotools/build-bash-completion | ||
---|---|---|
23 | 23 |
|
24 | 24 |
""" |
25 | 25 |
|
26 |
# pylint: disable-msg=C0103
|
|
26 |
# pylint: disable=C0103 |
|
27 | 27 |
# [C0103] Invalid name build-bash-completion |
28 | 28 |
|
29 | 29 |
import os |
... | ... | |
241 | 241 |
|
242 | 242 |
for opt in opts: |
243 | 243 |
# While documented, these variables aren't seen as public attributes by |
244 |
# pylint. pylint: disable-msg=W0212
|
|
244 |
# pylint. pylint: disable=W0212 |
|
245 | 245 |
opt.all_names = sorted(opt._short_opts + opt._long_opts) |
246 | 246 |
|
247 | 247 |
def _FindFirstArgument(self, sw): |
b/daemons/import-export | ||
---|---|---|
23 | 23 |
|
24 | 24 |
""" |
25 | 25 |
|
26 |
# pylint: disable-msg=C0103
|
|
26 |
# pylint: disable=C0103 |
|
27 | 27 |
# C0103: Invalid name import-export |
28 | 28 |
|
29 | 29 |
import errno |
... | ... | |
353 | 353 |
@return: Arguments to program |
354 | 354 |
|
355 | 355 |
""" |
356 |
global options # pylint: disable-msg=W0603
|
|
356 |
global options # pylint: disable=W0603 |
|
357 | 357 |
|
358 | 358 |
parser = optparse.OptionParser(usage=("%%prog <status-file> {%s|%s}" % |
359 | 359 |
(constants.IEM_IMPORT, |
... | ... | |
587 | 587 |
errmsg = "Exited with status %s" % (child.returncode, ) |
588 | 588 |
|
589 | 589 |
status_file.SetExitStatus(child.returncode, errmsg) |
590 |
except Exception, err: # pylint: disable-msg=W0703
|
|
590 |
except Exception, err: # pylint: disable=W0703 |
|
591 | 591 |
logging.exception("Unhandled error occurred") |
592 | 592 |
status_file.SetExitStatus(constants.EXIT_FAILURE, |
593 | 593 |
"Unhandled error occurred: %s" % (err, )) |
b/lib/asyncnotifier.py | ||
---|---|---|
26 | 26 |
import logging |
27 | 27 |
|
28 | 28 |
try: |
29 |
# pylint: disable-msg=E0611
|
|
29 |
# pylint: disable=E0611 |
|
30 | 30 |
from pyinotify import pyinotify |
31 | 31 |
except ImportError: |
32 | 32 |
import pyinotify |
... | ... | |
42 | 42 |
"""An asyncore dispatcher for inotify events. |
43 | 43 |
|
44 | 44 |
""" |
45 |
# pylint: disable-msg=W0622,W0212
|
|
45 |
# pylint: disable=W0622,W0212 |
|
46 | 46 |
def __init__(self, watch_manager, default_proc_fun=None, map=None): |
47 | 47 |
"""Initializes this class. |
48 | 48 |
|
... | ... | |
90 | 90 |
@param watch_manager: inotify watch manager |
91 | 91 |
|
92 | 92 |
""" |
93 |
# pylint: disable-msg=W0231
|
|
93 |
# pylint: disable=W0231 |
|
94 | 94 |
# no need to call the parent's constructor |
95 | 95 |
self.watch_manager = watch_manager |
96 | 96 |
|
... | ... | |
168 | 168 |
if self._watch_handle is not None and self.RemoveWatch(self._watch_handle): |
169 | 169 |
self._watch_handle = None |
170 | 170 |
|
171 |
# pylint: disable-msg=C0103
|
|
171 |
# pylint: disable=C0103 |
|
172 | 172 |
# this overrides a method in pyinotify.ProcessEvent |
173 | 173 |
def process_IN_IGNORED(self, event): |
174 | 174 |
# Since we monitor a single file rather than the directory it resides in, |
... | ... | |
182 | 182 |
self._watch_handle = None |
183 | 183 |
self._callback(False) |
184 | 184 |
|
185 |
# pylint: disable-msg=C0103
|
|
185 |
# pylint: disable=C0103 |
|
186 | 186 |
# this overrides a method in pyinotify.ProcessEvent |
187 | 187 |
def process_IN_MODIFY(self, event): |
188 | 188 |
# This gets called when the monitored file is modified. Note that this |
b/lib/backend.py | ||
---|---|---|
28 | 28 |
|
29 | 29 |
""" |
30 | 30 |
|
31 |
# pylint: disable-msg=E1103
|
|
31 |
# pylint: disable=E1103 |
|
32 | 32 |
|
33 | 33 |
# E1103: %s %r has no %r member (but some types could not be |
34 | 34 |
# inferred), because the _TryOSFromDisk returns either (True, os_obj) |
... | ... | |
412 | 412 |
utils.RemoveFile(constants.CONFD_HMAC_KEY) |
413 | 413 |
utils.RemoveFile(constants.RAPI_CERT_FILE) |
414 | 414 |
utils.RemoveFile(constants.NODED_CERT_FILE) |
415 |
except: # pylint: disable-msg=W0702
|
|
415 |
except: # pylint: disable=W0702 |
|
416 | 416 |
logging.exception("Error while removing cluster secrets") |
417 | 417 |
|
418 | 418 |
result = utils.RunCmd([constants.DAEMON_UTIL, "stop", constants.CONFD]) |
... | ... | |
1340 | 1340 |
|
1341 | 1341 |
""" |
1342 | 1342 |
# TODO: remove the obsolete "size" argument |
1343 |
# pylint: disable-msg=W0613
|
|
1343 |
# pylint: disable=W0613 |
|
1344 | 1344 |
clist = [] |
1345 | 1345 |
if disk.children: |
1346 | 1346 |
for child in disk.children: |
... | ... | |
1352 | 1352 |
# we need the children open in case the device itself has to |
1353 | 1353 |
# be assembled |
1354 | 1354 |
try: |
1355 |
# pylint: disable-msg=E1103
|
|
1355 |
# pylint: disable=E1103 |
|
1356 | 1356 |
crdev.Open() |
1357 | 1357 |
except errors.BlockDeviceError, err: |
1358 | 1358 |
_Fail("Can't make child '%s' read-write: %s", child, err) |
... | ... | |
1568 | 1568 |
try: |
1569 | 1569 |
result = _RecursiveAssembleBD(disk, owner, as_primary) |
1570 | 1570 |
if isinstance(result, bdev.BlockDev): |
1571 |
# pylint: disable-msg=E1103
|
|
1571 |
# pylint: disable=E1103 |
|
1572 | 1572 |
result = result.dev_path |
1573 | 1573 |
if as_primary: |
1574 | 1574 |
_SymlinkBlockDev(owner, result, idx) |
... | ... | |
3322 | 3322 |
# ensure the child is running on ram |
3323 | 3323 |
try: |
3324 | 3324 |
utils.Mlockall() |
3325 |
except Exception: # pylint: disable-msg=W0703
|
|
3325 |
except Exception: # pylint: disable=W0703 |
|
3326 | 3326 |
pass |
3327 | 3327 |
time.sleep(5) |
3328 | 3328 |
hyper.PowercycleNode() |
... | ... | |
3347 | 3347 |
hooks_base_dir = constants.HOOKS_BASE_DIR |
3348 | 3348 |
# yeah, _BASE_DIR is not valid for attributes, we use it like a |
3349 | 3349 |
# constant |
3350 |
self._BASE_DIR = hooks_base_dir # pylint: disable-msg=C0103
|
|
3350 |
self._BASE_DIR = hooks_base_dir # pylint: disable=C0103 |
|
3351 | 3351 |
|
3352 | 3352 |
def RunHooks(self, hpath, phase, env): |
3353 | 3353 |
"""Run the scripts in the hooks directory. |
b/lib/bdev.py | ||
---|---|---|
889 | 889 |
self.est_time = None |
890 | 890 |
|
891 | 891 |
|
892 |
class BaseDRBD(BlockDev): # pylint: disable-msg=W0223
|
|
892 |
class BaseDRBD(BlockDev): # pylint: disable=W0223 |
|
893 | 893 |
"""Base DRBD class. |
894 | 894 |
|
895 | 895 |
This class contains a few bits of common functionality between the |
... | ... | |
1765 | 1765 |
|
1766 | 1766 |
""" |
1767 | 1767 |
# TODO: Rewrite to not use a for loop just because there is 'break' |
1768 |
# pylint: disable-msg=W0631
|
|
1768 |
# pylint: disable=W0631 |
|
1769 | 1769 |
net_data = (self._lhost, self._lport, self._rhost, self._rport) |
1770 | 1770 |
for minor in (self._aminor,): |
1771 | 1771 |
info = self._GetDevInfo(self._GetShowData(minor)) |
b/lib/bootstrap.py | ||
---|---|---|
242 | 242 |
return file_storage_dir |
243 | 243 |
|
244 | 244 |
|
245 |
def InitCluster(cluster_name, mac_prefix, # pylint: disable-msg=R0913
|
|
245 |
def InitCluster(cluster_name, mac_prefix, # pylint: disable=R0913 |
|
246 | 246 |
master_netdev, file_storage_dir, shared_file_storage_dir, |
247 | 247 |
candidate_pool_size, secondary_ip=None, vg_name=None, |
248 | 248 |
beparams=None, nicparams=None, ndparams=None, hvparams=None, |
b/lib/build/sphinx_ext.py | ||
---|---|---|
42 | 42 |
from ganeti import ht |
43 | 43 |
from ganeti import rapi |
44 | 44 |
|
45 |
import ganeti.rapi.rlib2 # pylint: disable-msg=W0611
|
|
45 |
import ganeti.rapi.rlib2 # pylint: disable=W0611 |
|
46 | 46 |
|
47 | 47 |
|
48 | 48 |
COMMON_PARAM_NAMES = map(compat.fst, opcodes.OpCode.OP_PARAMS) |
... | ... | |
213 | 213 |
The expression's result is included as a literal. |
214 | 214 |
|
215 | 215 |
""" |
216 |
# pylint: disable-msg=W0102,W0613,W0142
|
|
216 |
# pylint: disable=W0102,W0613,W0142 |
|
217 | 217 |
# W0102: Dangerous default value as argument |
218 | 218 |
# W0142: Used * or ** magic |
219 | 219 |
# W0613: Unused argument |
... | ... | |
222 | 222 |
|
223 | 223 |
try: |
224 | 224 |
result = eval(code, EVAL_NS) |
225 |
except Exception, err: # pylint: disable-msg=W0703
|
|
225 |
except Exception, err: # pylint: disable=W0703 |
|
226 | 226 |
msg = inliner.reporter.error("Failed to evaluate %r: %s" % (code, err), |
227 | 227 |
line=lineno) |
228 | 228 |
return ([inliner.problematic(rawtext, rawtext, msg)], [msg]) |
b/lib/cli.py | ||
---|---|---|
259 | 259 |
|
260 | 260 |
|
261 | 261 |
class _Argument: |
262 |
def __init__(self, min=0, max=None): # pylint: disable-msg=W0622
|
|
262 |
def __init__(self, min=0, max=None): # pylint: disable=W0622 |
|
263 | 263 |
self.min = min |
264 | 264 |
self.max = max |
265 | 265 |
|
... | ... | |
274 | 274 |
Value can be any of the ones passed to the constructor. |
275 | 275 |
|
276 | 276 |
""" |
277 |
# pylint: disable-msg=W0622
|
|
277 |
# pylint: disable=W0622 |
|
278 | 278 |
def __init__(self, min=0, max=None, choices=None): |
279 | 279 |
_Argument.__init__(self, min=min, max=max) |
280 | 280 |
self.choices = choices |
... | ... | |
462 | 462 |
SubmitOpCode(op, opts=opts) |
463 | 463 |
|
464 | 464 |
|
465 |
def check_unit(option, opt, value): # pylint: disable-msg=W0613
|
|
465 |
def check_unit(option, opt, value): # pylint: disable=W0613 |
|
466 | 466 |
"""OptParsers custom converter for units. |
467 | 467 |
|
468 | 468 |
""" |
... | ... | |
509 | 509 |
return kv_dict |
510 | 510 |
|
511 | 511 |
|
512 |
def check_ident_key_val(option, opt, value): # pylint: disable-msg=W0613
|
|
512 |
def check_ident_key_val(option, opt, value): # pylint: disable=W0613 |
|
513 | 513 |
"""Custom parser for ident:key=val,key=val options. |
514 | 514 |
|
515 | 515 |
This will store the parsed values as a tuple (ident, {key: val}). As such, |
... | ... | |
537 | 537 |
return retval |
538 | 538 |
|
539 | 539 |
|
540 |
def check_key_val(option, opt, value): # pylint: disable-msg=W0613
|
|
540 |
def check_key_val(option, opt, value): # pylint: disable=W0613 |
|
541 | 541 |
"""Custom parser class for key=val,key=val options. |
542 | 542 |
|
543 | 543 |
This will store the parsed values as a dict {key: val}. |
... | ... | |
546 | 546 |
return _SplitKeyVal(opt, value) |
547 | 547 |
|
548 | 548 |
|
549 |
def check_bool(option, opt, value): # pylint: disable-msg=W0613
|
|
549 |
def check_bool(option, opt, value): # pylint: disable=W0613 |
|
550 | 550 |
"""Custom parser for yes/no options. |
551 | 551 |
|
552 | 552 |
This will store the parsed value as either True or False. |
... | ... | |
2363 | 2363 |
if unitfields is None: |
2364 | 2364 |
unitfields = [] |
2365 | 2365 |
|
2366 |
numfields = utils.FieldSet(*numfields) # pylint: disable-msg=W0142
|
|
2367 |
unitfields = utils.FieldSet(*unitfields) # pylint: disable-msg=W0142
|
|
2366 |
numfields = utils.FieldSet(*numfields) # pylint: disable=W0142 |
|
2367 |
unitfields = utils.FieldSet(*unitfields) # pylint: disable=W0142 |
|
2368 | 2368 |
|
2369 | 2369 |
format_fields = [] |
2370 | 2370 |
for field in fields: |
b/lib/client/gnt_backup.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
"""Backup related commands""" |
22 | 22 |
|
23 |
# pylint: disable-msg=W0401,W0613,W0614,C0103
|
|
23 |
# pylint: disable=W0401,W0613,W0614,C0103 |
|
24 | 24 |
# W0401: Wildcard import ganeti.cli |
25 | 25 |
# W0613: Unused argument, since all functions follow the same API |
26 | 26 |
# W0614: Unused import %s from wildcard import (since we need cli) |
b/lib/client/gnt_cluster.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
"""Cluster related commands""" |
22 | 22 |
|
23 |
# pylint: disable-msg=W0401,W0613,W0614,C0103
|
|
23 |
# pylint: disable=W0401,W0613,W0614,C0103 |
|
24 | 24 |
# W0401: Wildcard import ganeti.cli |
25 | 25 |
# W0613: Unused argument, since all functions follow the same API |
26 | 26 |
# W0614: Unused import %s from wildcard import (since we need cli) |
... | ... | |
622 | 622 |
cl = GetClient() |
623 | 623 |
cl.QueryClusterInfo() |
624 | 624 |
return 0 |
625 |
except Exception: # pylint: disable-msg=W0703
|
|
625 |
except Exception: # pylint: disable=W0703 |
|
626 | 626 |
return 1 |
627 | 627 |
|
628 | 628 |
|
... | ... | |
685 | 685 |
|
686 | 686 |
OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, |
687 | 687 |
rapi_cert_pem) |
688 |
except Exception, err: # pylint: disable-msg=W0703
|
|
688 |
except Exception, err: # pylint: disable=W0703 |
|
689 | 689 |
ToStderr("Can't load new RAPI certificate from %s: %s" % |
690 | 690 |
(rapi_cert_filename, str(err))) |
691 | 691 |
return 1 |
692 | 692 |
|
693 | 693 |
try: |
694 | 694 |
OpenSSL.crypto.load_privatekey(OpenSSL.crypto.FILETYPE_PEM, rapi_cert_pem) |
695 |
except Exception, err: # pylint: disable-msg=W0703
|
|
695 |
except Exception, err: # pylint: disable=W0703 |
|
696 | 696 |
ToStderr("Can't load new RAPI private key from %s: %s" % |
697 | 697 |
(rapi_cert_filename, str(err))) |
698 | 698 |
return 1 |
... | ... | |
703 | 703 |
if cds_filename: |
704 | 704 |
try: |
705 | 705 |
cds = utils.ReadFile(cds_filename) |
706 |
except Exception, err: # pylint: disable-msg=W0703
|
|
706 |
except Exception, err: # pylint: disable=W0703 |
|
707 | 707 |
ToStderr("Can't load new cluster domain secret from %s: %s" % |
708 | 708 |
(cds_filename, str(err))) |
709 | 709 |
return 1 |
b/lib/client/gnt_debug.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
"""Debugging commands""" |
22 | 22 |
|
23 |
# pylint: disable-msg=W0401,W0614,C0103
|
|
23 |
# pylint: disable=W0401,W0614,C0103 |
|
24 | 24 |
# W0401: Wildcard import ganeti.cli |
25 | 25 |
# W0614: Unused import %s from wildcard import (since we need cli) |
26 | 26 |
# C0103: Invalid name gnt-backup |
... | ... | |
90 | 90 |
ToStdout("Loading...") |
91 | 91 |
for job_idx in range(opts.rep_job): |
92 | 92 |
for fname in args: |
93 |
# pylint: disable-msg=W0142
|
|
93 |
# pylint: disable=W0142 |
|
94 | 94 |
op_data = simplejson.loads(utils.ReadFile(fname)) |
95 | 95 |
op_list = [opcodes.OpCode.LoadOpCode(val) for val in op_data] |
96 | 96 |
op_list = op_list * opts.rep_op |
... | ... | |
564 | 564 |
return 0 |
565 | 565 |
|
566 | 566 |
|
567 |
def ListLocks(opts, args): # pylint: disable-msg=W0613
|
|
567 |
def ListLocks(opts, args): # pylint: disable=W0613 |
|
568 | 568 |
"""List all locks. |
569 | 569 |
|
570 | 570 |
@param opts: the command line options selected by the user |
b/lib/client/gnt_group.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
"""Node group related commands""" |
22 | 22 |
|
23 |
# pylint: disable-msg=W0401,W0614
|
|
23 |
# pylint: disable=W0401,W0614 |
|
24 | 24 |
# W0401: Wildcard import ganeti.cli |
25 | 25 |
# W0614: Unused import %s from wildcard import (since we need cli) |
26 | 26 |
|
b/lib/client/gnt_instance.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
"""Instance related commands""" |
22 | 22 |
|
23 |
# pylint: disable-msg=W0401,W0614,C0103
|
|
23 |
# pylint: disable=W0401,W0614,C0103 |
|
24 | 24 |
# W0401: Wildcard import ganeti.cli |
25 | 25 |
# W0614: Unused import %s from wildcard import (since we need cli) |
26 | 26 |
# C0103: Invalid name gnt-instance |
... | ... | |
87 | 87 |
@raise errors.OpPrereqError: for invalid input parameters |
88 | 88 |
|
89 | 89 |
""" |
90 |
# pylint: disable-msg=W0142
|
|
90 |
# pylint: disable=W0142 |
|
91 | 91 |
|
92 | 92 |
if client is None: |
93 | 93 |
client = GetClient() |
... | ... | |
322 | 322 |
json_filename = args[0] |
323 | 323 |
try: |
324 | 324 |
instance_data = simplejson.loads(utils.ReadFile(json_filename)) |
325 |
except Exception, err: # pylint: disable-msg=W0703
|
|
325 |
except Exception, err: # pylint: disable=W0703 |
|
326 | 326 |
ToStderr("Can't parse the instance definition file: %s" % str(err)) |
327 | 327 |
return 1 |
328 | 328 |
|
... | ... | |
335 | 335 |
# Iterate over the instances and do: |
336 | 336 |
# * Populate the specs with default value |
337 | 337 |
# * Validate the instance specs |
338 |
i_names = utils.NiceSort(instance_data.keys()) # pylint: disable-msg=E1103
|
|
338 |
i_names = utils.NiceSort(instance_data.keys()) # pylint: disable=E1103 |
|
339 | 339 |
for name in i_names: |
340 | 340 |
specs = instance_data[name] |
341 | 341 |
specs = _PopulateWithDefaults(specs) |
b/lib/client/gnt_job.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
"""Job related commands""" |
22 | 22 |
|
23 |
# pylint: disable-msg=W0401,W0613,W0614,C0103
|
|
23 |
# pylint: disable=W0401,W0613,W0614,C0103 |
|
24 | 24 |
# W0401: Wildcard import ganeti.cli |
25 | 25 |
# W0613: Unused argument, since all functions follow the same API |
26 | 26 |
# W0614: Unused import %s from wildcard import (since we need cli) |
b/lib/client/gnt_node.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
"""Node related commands""" |
22 | 22 |
|
23 |
# pylint: disable-msg=W0401,W0613,W0614,C0103
|
|
23 |
# pylint: disable=W0401,W0613,W0614,C0103 |
|
24 | 24 |
# W0401: Wildcard import ganeti.cli |
25 | 25 |
# W0613: Unused argument, since all functions follow the same API |
26 | 26 |
# W0614: Unused import %s from wildcard import (since we need cli) |
b/lib/client/gnt_os.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
"""OS scripts related commands""" |
22 | 22 |
|
23 |
# pylint: disable-msg=W0401,W0613,W0614,C0103
|
|
23 |
# pylint: disable=W0401,W0613,W0614,C0103 |
|
24 | 24 |
# W0401: Wildcard import ganeti.cli |
25 | 25 |
# W0613: Unused argument, since all functions follow the same API |
26 | 26 |
# W0614: Unused import %s from wildcard import (since we need cli) |
b/lib/cmdlib.py | ||
---|---|---|
21 | 21 |
|
22 | 22 |
"""Module implementing the master-side code.""" |
23 | 23 |
|
24 |
# pylint: disable-msg=W0201,C0302
|
|
24 |
# pylint: disable=W0201,C0302 |
|
25 | 25 |
|
26 | 26 |
# W0201 since most LU attributes are defined in CheckPrereq or similar |
27 | 27 |
# functions |
... | ... | |
60 | 60 |
from ganeti import opcodes |
61 | 61 |
from ganeti import ht |
62 | 62 |
|
63 |
import ganeti.masterd.instance # pylint: disable-msg=W0611
|
|
63 |
import ganeti.masterd.instance # pylint: disable=W0611 |
|
64 | 64 |
|
65 | 65 |
|
66 | 66 |
class ResultWithJobs: |
... | ... | |
131 | 131 |
# Used to force good behavior when calling helper functions |
132 | 132 |
self.recalculate_locks = {} |
133 | 133 |
# logging |
134 |
self.Log = processor.Log # pylint: disable-msg=C0103
|
|
135 |
self.LogWarning = processor.LogWarning # pylint: disable-msg=C0103
|
|
136 |
self.LogInfo = processor.LogInfo # pylint: disable-msg=C0103
|
|
137 |
self.LogStep = processor.LogStep # pylint: disable-msg=C0103
|
|
134 |
self.Log = processor.Log # pylint: disable=C0103 |
|
135 |
self.LogWarning = processor.LogWarning # pylint: disable=C0103 |
|
136 |
self.LogInfo = processor.LogInfo # pylint: disable=C0103 |
|
137 |
self.LogStep = processor.LogStep # pylint: disable=C0103 |
|
138 | 138 |
# support for dry-run |
139 | 139 |
self.dry_run_result = None |
140 | 140 |
# support for generic debug attribute |
... | ... | |
322 | 322 |
""" |
323 | 323 |
# API must be kept, thus we ignore the unused argument and could |
324 | 324 |
# be a function warnings |
325 |
# pylint: disable-msg=W0613,R0201
|
|
325 |
# pylint: disable=W0613,R0201 |
|
326 | 326 |
return lu_result |
327 | 327 |
|
328 | 328 |
def _ExpandAndLockInstance(self): |
... | ... | |
390 | 390 |
del self.recalculate_locks[locking.LEVEL_NODE] |
391 | 391 |
|
392 | 392 |
|
393 |
class NoHooksLU(LogicalUnit): # pylint: disable-msg=W0223
|
|
393 |
class NoHooksLU(LogicalUnit): # pylint: disable=W0223 |
|
394 | 394 |
"""Simple LU which runs no hooks. |
395 | 395 |
|
396 | 396 |
This LU is intended as a parent for other LogicalUnits which will |
... | ... | |
757 | 757 |
try: |
758 | 758 |
hm.RunPhase(constants.HOOKS_PHASE_POST, nodes=[node_name]) |
759 | 759 |
except: |
760 |
# pylint: disable-msg=W0702
|
|
760 |
# pylint: disable=W0702 |
|
761 | 761 |
lu.LogWarning("Errors occurred running hooks on %s" % node_name) |
762 | 762 |
|
763 | 763 |
|
... | ... | |
1087 | 1087 |
} |
1088 | 1088 |
if override: |
1089 | 1089 |
args.update(override) |
1090 |
return _BuildInstanceHookEnv(**args) # pylint: disable-msg=W0142
|
|
1090 |
return _BuildInstanceHookEnv(**args) # pylint: disable=W0142 |
|
1091 | 1091 |
|
1092 | 1092 |
|
1093 | 1093 |
def _AdjustCandidatePool(lu, exceptions): |
... | ... | |
1371 | 1371 |
try: |
1372 | 1372 |
cert = OpenSSL.crypto.load_certificate(OpenSSL.crypto.FILETYPE_PEM, |
1373 | 1373 |
utils.ReadFile(filename)) |
1374 |
except Exception, err: # pylint: disable-msg=W0703
|
|
1374 |
except Exception, err: # pylint: disable=W0703 |
|
1375 | 1375 |
return (LUClusterVerifyConfig.ETYPE_ERROR, |
1376 | 1376 |
"Failed to load X509 certificate %s: %s" % (filename, err)) |
1377 | 1377 |
|
... | ... | |
1486 | 1486 |
if args: |
1487 | 1487 |
msg = msg % args |
1488 | 1488 |
# then format the whole message |
1489 |
if self.op.error_codes: # This is a mix-in. pylint: disable-msg=E1101
|
|
1489 |
if self.op.error_codes: # This is a mix-in. pylint: disable=E1101 |
|
1490 | 1490 |
msg = "%s:%s:%s:%s:%s" % (ltype, etxt, itype, item, msg) |
1491 | 1491 |
else: |
1492 | 1492 |
if item: |
... | ... | |
1495 | 1495 |
item = "" |
1496 | 1496 |
msg = "%s: %s%s: %s" % (ltype, itype, item, msg) |
1497 | 1497 |
# and finally report it via the feedback_fn |
1498 |
self._feedback_fn(" - %s" % msg) # Mix-in. pylint: disable-msg=E1101
|
|
1498 |
self._feedback_fn(" - %s" % msg) # Mix-in. pylint: disable=E1101 |
|
1499 | 1499 |
|
1500 | 1500 |
def _ErrorIf(self, cond, *args, **kwargs): |
1501 | 1501 |
"""Log an error message if the passed condition is True. |
1502 | 1502 |
|
1503 | 1503 |
""" |
1504 | 1504 |
cond = (bool(cond) |
1505 |
or self.op.debug_simulate_errors) # pylint: disable-msg=E1101
|
|
1505 |
or self.op.debug_simulate_errors) # pylint: disable=E1101 |
|
1506 | 1506 |
if cond: |
1507 | 1507 |
self._Error(*args, **kwargs) |
1508 | 1508 |
# do not mark the operation as failed for WARN cases only |
... | ... | |
1539 | 1539 |
for group in groups) |
1540 | 1540 |
|
1541 | 1541 |
# Fix up all parameters |
1542 |
for op in itertools.chain(*jobs): # pylint: disable-msg=W0142
|
|
1542 |
for op in itertools.chain(*jobs): # pylint: disable=W0142 |
|
1543 | 1543 |
op.debug_simulate_errors = self.op.debug_simulate_errors |
1544 | 1544 |
op.verbose = self.op.verbose |
1545 | 1545 |
op.error_codes = self.op.error_codes |
... | ... | |
1801 | 1801 |
|
1802 | 1802 |
""" |
1803 | 1803 |
node = ninfo.name |
1804 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
1804 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
1805 | 1805 |
|
1806 | 1806 |
# main result, nresult should be a non-empty dict |
1807 | 1807 |
test = not nresult or not isinstance(nresult, dict) |
... | ... | |
1870 | 1870 |
|
1871 | 1871 |
""" |
1872 | 1872 |
node = ninfo.name |
1873 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
1873 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
1874 | 1874 |
|
1875 | 1875 |
ntime = nresult.get(constants.NV_TIME, None) |
1876 | 1876 |
try: |
... | ... | |
1903 | 1903 |
return |
1904 | 1904 |
|
1905 | 1905 |
node = ninfo.name |
1906 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
1906 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
1907 | 1907 |
|
1908 | 1908 |
# checks vg existence and size > 20G |
1909 | 1909 |
vglist = nresult.get(constants.NV_VGLIST, None) |
... | ... | |
1940 | 1940 |
return |
1941 | 1941 |
|
1942 | 1942 |
node = ninfo.name |
1943 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
1943 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
1944 | 1944 |
|
1945 | 1945 |
missing = nresult.get(constants.NV_BRIDGES, None) |
1946 | 1946 |
test = not isinstance(missing, list) |
... | ... | |
1959 | 1959 |
|
1960 | 1960 |
""" |
1961 | 1961 |
node = ninfo.name |
1962 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
1962 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
1963 | 1963 |
|
1964 | 1964 |
test = constants.NV_NODELIST not in nresult |
1965 | 1965 |
_ErrorIf(test, self.ENODESSH, node, |
... | ... | |
2000 | 2000 |
available on the instance's node. |
2001 | 2001 |
|
2002 | 2002 |
""" |
2003 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
2003 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
2004 | 2004 |
node_current = instanceconfig.primary_node |
2005 | 2005 |
|
2006 | 2006 |
node_vol_should = {} |
... | ... | |
2200 | 2200 |
|
2201 | 2201 |
""" |
2202 | 2202 |
node = ninfo.name |
2203 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
2203 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
2204 | 2204 |
|
2205 | 2205 |
if drbd_helper: |
2206 | 2206 |
helper_result = nresult.get(constants.NV_DRBDHELPER, None) |
... | ... | |
2259 | 2259 |
|
2260 | 2260 |
""" |
2261 | 2261 |
node = ninfo.name |
2262 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
2262 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
2263 | 2263 |
|
2264 | 2264 |
remote_os = nresult.get(constants.NV_OSLIST, None) |
2265 | 2265 |
test = (not isinstance(remote_os, list) or |
... | ... | |
2300 | 2300 |
|
2301 | 2301 |
""" |
2302 | 2302 |
node = ninfo.name |
2303 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
2303 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
2304 | 2304 |
|
2305 | 2305 |
assert not nimg.os_fail, "Entered _VerifyNodeOS with failed OS rpc?" |
2306 | 2306 |
|
... | ... | |
2370 | 2370 |
|
2371 | 2371 |
""" |
2372 | 2372 |
node = ninfo.name |
2373 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
2373 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
2374 | 2374 |
|
2375 | 2375 |
nimg.lvm_fail = True |
2376 | 2376 |
lvdata = nresult.get(constants.NV_LVLIST, "Missing LV data") |
... | ... | |
2418 | 2418 |
|
2419 | 2419 |
""" |
2420 | 2420 |
node = ninfo.name |
2421 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
2421 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
2422 | 2422 |
|
2423 | 2423 |
# try to read free memory (from the hypervisor) |
2424 | 2424 |
hv_info = nresult.get(constants.NV_HVINFO, None) |
... | ... | |
2460 | 2460 |
list of tuples (success, payload) |
2461 | 2461 |
|
2462 | 2462 |
""" |
2463 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
2463 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
2464 | 2464 |
|
2465 | 2465 |
node_disks = {} |
2466 | 2466 |
node_disks_devonly = {} |
... | ... | |
2568 | 2568 |
"""Verify integrity of the node group, performing various test on nodes. |
2569 | 2569 |
|
2570 | 2570 |
""" |
2571 |
# This method has too many local variables. pylint: disable-msg=R0914
|
|
2571 |
# This method has too many local variables. pylint: disable=R0914 |
|
2572 | 2572 |
feedback_fn("* Verifying group '%s'" % self.group_info.name) |
2573 | 2573 |
|
2574 | 2574 |
if not self.my_node_names: |
... | ... | |
2577 | 2577 |
return True |
2578 | 2578 |
|
2579 | 2579 |
self.bad = False |
2580 |
_ErrorIf = self._ErrorIf # pylint: disable-msg=C0103
|
|
2580 |
_ErrorIf = self._ErrorIf # pylint: disable=C0103 |
|
2581 | 2581 |
verbose = self.op.verbose |
2582 | 2582 |
self._feedback_fn = feedback_fn |
2583 | 2583 |
|
... | ... | |
4419 | 4419 |
"""Logical unit for querying nodes. |
4420 | 4420 |
|
4421 | 4421 |
""" |
4422 |
# pylint: disable-msg=W0142
|
|
4422 |
# pylint: disable=W0142 |
|
4423 | 4423 |
REQ_BGL = False |
4424 | 4424 |
|
4425 | 4425 |
def CheckArguments(self): |
... | ... | |
4620 | 4620 |
for instance_name in lu.owned_locks(locking.LEVEL_INSTANCE) |
4621 | 4621 |
for group_uuid in lu.cfg.GetInstanceNodeGroups(instance_name)) |
4622 | 4622 |
elif level == locking.LEVEL_NODE: |
4623 |
lu._LockInstancesNodes() # pylint: disable-msg=W0212
|
|
4623 |
lu._LockInstancesNodes() # pylint: disable=W0212 |
|
4624 | 4624 |
|
4625 | 4625 |
@staticmethod |
4626 | 4626 |
def _CheckGroupLocks(lu): |
... | ... | |
4721 | 4721 |
"""Query for resources/items of a certain kind. |
4722 | 4722 |
|
4723 | 4723 |
""" |
4724 |
# pylint: disable-msg=W0142
|
|
4724 |
# pylint: disable=W0142 |
|
4725 | 4725 |
REQ_BGL = False |
4726 | 4726 |
|
4727 | 4727 |
def CheckArguments(self): |
... | ... | |
4743 | 4743 |
"""Query for resources/items of a certain kind. |
4744 | 4744 |
|
4745 | 4745 |
""" |
4746 |
# pylint: disable-msg=W0142
|
|
4746 |
# pylint: disable=W0142 |
|
4747 | 4747 |
REQ_BGL = False |
4748 | 4748 |
|
4749 | 4749 |
def CheckArguments(self): |
... | ... | |
4990 | 4990 |
# later in the procedure; this also means that if the re-add |
4991 | 4991 |
# fails, we are left with a non-offlined, broken node |
4992 | 4992 |
if self.op.readd: |
4993 |
new_node.drained = new_node.offline = False # pylint: disable-msg=W0201
|
|
4993 |
new_node.drained = new_node.offline = False # pylint: disable=W0201 |
|
4994 | 4994 |
self.LogInfo("Readding a node, the offline/drained flags were reset") |
4995 | 4995 |
# if we demote the node, we do cleanup later in the procedure |
4996 | 4996 |
new_node.master_candidate = self.master_candidate |
... | ... | |
6550 | 6550 |
"""Logical unit for querying instances. |
6551 | 6551 |
|
6552 | 6552 |
""" |
6553 |
# pylint: disable-msg=W0142
|
|
6553 |
# pylint: disable=W0142 |
|
6554 | 6554 |
REQ_BGL = False |
6555 | 6555 |
|
6556 | 6556 |
def CheckArguments(self): |
... | ... | |
8515 | 8515 |
|
8516 | 8516 |
joinargs.append(self.op.instance_name) |
8517 | 8517 |
|
8518 |
# pylint: disable-msg=W0142
|
|
8518 |
# pylint: disable=W0142 |
|
8519 | 8519 |
self.instance_file_storage_dir = utils.PathJoin(*joinargs) |
8520 | 8520 |
|
8521 | 8521 |
def CheckPrereq(self): |
... | ... | |
9674 | 9674 |
self.lu.LogWarning("Can't remove old LV: %s" % msg, |
9675 | 9675 |
hint="remove unused LVs manually") |
9676 | 9676 |
|
9677 |
def _ExecDrbd8DiskOnly(self, feedback_fn): # pylint: disable-msg=W0613
|
|
9677 |
def _ExecDrbd8DiskOnly(self, feedback_fn): # pylint: disable=W0613 |
|
9678 | 9678 |
"""Replace a disk on the primary or secondary for DRBD 8. |
9679 | 9679 |
|
9680 | 9680 |
The algorithm for replace is quite complicated: |
... | ... | |
12436 | 12436 |
return ResultWithJobs(jobs) |
12437 | 12437 |
|
12438 | 12438 |
|
12439 |
class TagsLU(NoHooksLU): # pylint: disable-msg=W0223
|
|
12439 |
class TagsLU(NoHooksLU): # pylint: disable=W0223 |
|
12440 | 12440 |
"""Generic tags LU. |
12441 | 12441 |
|
12442 | 12442 |
This is an abstract class which is the parent of all the other tags LUs. |
... | ... | |
12696 | 12696 |
# Wait for client to close |
12697 | 12697 |
try: |
12698 | 12698 |
try: |
12699 |
# pylint: disable-msg=E1101
|
|
12699 |
# pylint: disable=E1101 |
|
12700 | 12700 |
# Instance of '_socketobject' has no ... member |
12701 | 12701 |
conn.settimeout(cls._CLIENT_CONFIRM_TIMEOUT) |
12702 | 12702 |
conn.recv(1) |
... | ... | |
12793 | 12793 |
easy usage |
12794 | 12794 |
|
12795 | 12795 |
""" |
12796 |
# pylint: disable-msg=R0902
|
|
12796 |
# pylint: disable=R0902 |
|
12797 | 12797 |
# lots of instance attributes |
12798 | 12798 |
|
12799 | 12799 |
def __init__(self, cfg, rpc, mode, **kwargs): |
... | ... | |
13130 | 13130 |
|
13131 | 13131 |
_STRING_LIST = ht.TListOf(ht.TString) |
13132 | 13132 |
_JOB_LIST = ht.TListOf(ht.TListOf(ht.TStrictDict(True, False, { |
13133 |
# pylint: disable-msg=E1101
|
|
13133 |
# pylint: disable=E1101 |
|
13134 | 13134 |
# Class '...' has no 'OP_ID' member |
13135 | 13135 |
"OP_ID": ht.TElemOf([opcodes.OpInstanceFailover.OP_ID, |
13136 | 13136 |
opcodes.OpInstanceMigrate.OP_ID, |
b/lib/compat.py | ||
---|---|---|
27 | 27 |
import operator |
28 | 28 |
|
29 | 29 |
try: |
30 |
# pylint: disable-msg=F0401
|
|
30 |
# pylint: disable=F0401 |
|
31 | 31 |
import functools |
32 | 32 |
except ImportError: |
33 | 33 |
functools = None |
34 | 34 |
|
35 | 35 |
try: |
36 |
# pylint: disable-msg=F0401
|
|
36 |
# pylint: disable=F0401 |
|
37 | 37 |
import roman |
38 | 38 |
except ImportError: |
39 | 39 |
roman = None |
... | ... | |
45 | 45 |
# modules (hmac, for example) which have changed their behavior as well from |
46 | 46 |
# one version to the other. |
47 | 47 |
try: |
48 |
# pylint: disable-msg=F0401
|
|
48 |
# pylint: disable=F0401 |
|
49 | 49 |
# Yes, we're not using the imports in this module. |
50 |
# pylint: disable-msg=W0611
|
|
50 |
# pylint: disable=W0611 |
|
51 | 51 |
from hashlib import md5 as md5_hash |
52 | 52 |
from hashlib import sha1 as sha1_hash |
53 | 53 |
# this additional version is needed for compatibility with the hmac module |
... | ... | |
78 | 78 |
|
79 | 79 |
|
80 | 80 |
try: |
81 |
# pylint: disable-msg=E0601
|
|
82 |
# pylint: disable-msg=W0622
|
|
81 |
# pylint: disable=E0601 |
|
82 |
# pylint: disable=W0622 |
|
83 | 83 |
all = all |
84 | 84 |
except NameError: |
85 | 85 |
all = _all |
86 | 86 |
|
87 | 87 |
try: |
88 |
# pylint: disable-msg=E0601
|
|
89 |
# pylint: disable-msg=W0622
|
|
88 |
# pylint: disable=E0601 |
|
89 |
# pylint: disable=W0622 |
|
90 | 90 |
any = any |
91 | 91 |
except NameError: |
92 | 92 |
any = _any |
93 | 93 |
|
94 | 94 |
|
95 |
def partition(seq, pred=bool): # pylint: disable-msg=W0622
|
|
95 |
def partition(seq, pred=bool): # pylint: disable=W0622 |
|
96 | 96 |
"""Partition a list in two, based on the given predicate. |
97 | 97 |
|
98 | 98 |
""" |
... | ... | |
102 | 102 |
|
103 | 103 |
# Even though we're using Python's built-in "partial" function if available, |
104 | 104 |
# this one is always defined for testing. |
105 |
def _partial(func, *args, **keywords): # pylint: disable-msg=W0622
|
|
105 |
def _partial(func, *args, **keywords): # pylint: disable=W0622 |
|
106 | 106 |
"""Decorator with partial application of arguments and keywords. |
107 | 107 |
|
108 | 108 |
This function was copied from Python's documentation. |
... | ... | |
111 | 111 |
def newfunc(*fargs, **fkeywords): |
112 | 112 |
newkeywords = keywords.copy() |
113 | 113 |
newkeywords.update(fkeywords) |
114 |
return func(*(args + fargs), **newkeywords) # pylint: disable-msg=W0142
|
|
114 |
return func(*(args + fargs), **newkeywords) # pylint: disable=W0142 |
|
115 | 115 |
|
116 | 116 |
newfunc.func = func |
117 | 117 |
newfunc.args = args |
b/lib/confd/client.py | ||
---|---|---|
45 | 45 |
|
46 | 46 |
""" |
47 | 47 |
|
48 |
# pylint: disable-msg=E0203
|
|
48 |
# pylint: disable=E0203 |
|
49 | 49 |
|
50 | 50 |
# E0203: Access to member %r before its definition, since we use |
51 | 51 |
# objects.py which doesn't explicitely initialise its members |
... | ... | |
156 | 156 |
|
157 | 157 |
""" |
158 | 158 |
# we are actually called from init, so: |
159 |
# pylint: disable-msg=W0201
|
|
159 |
# pylint: disable=W0201 |
|
160 | 160 |
if not isinstance(peers, list): |
161 | 161 |
raise errors.ProgrammerError("peers must be a list") |
162 | 162 |
# make a copy of peers, since we're going to shuffle the list, later |
b/lib/confd/querylib.py | ||
---|---|---|
50 | 50 |
""" |
51 | 51 |
self.reader = reader |
52 | 52 |
|
53 |
def Exec(self, query): # pylint: disable-msg=R0201,W0613
|
|
53 |
def Exec(self, query): # pylint: disable=R0201,W0613 |
|
54 | 54 |
"""Process a single UDP request from a client. |
55 | 55 |
|
56 | 56 |
Different queries should override this function, which by defaults returns |
b/lib/config.py | ||
---|---|---|
31 | 31 |
|
32 | 32 |
""" |
33 | 33 |
|
34 |
# pylint: disable-msg=R0904
|
|
34 |
# pylint: disable=R0904 |
|
35 | 35 |
# R0904: Too many public methods |
36 | 36 |
|
37 | 37 |
import os |
... | ... | |
374 | 374 |
configuration errors |
375 | 375 |
|
376 | 376 |
""" |
377 |
# pylint: disable-msg=R0914
|
|
377 |
# pylint: disable=R0914 |
|
378 | 378 |
result = [] |
379 | 379 |
seen_macs = [] |
380 | 380 |
ports = {} |
b/lib/daemon.py | ||
---|---|---|
539 | 539 |
err.errno) |
540 | 540 |
else: |
541 | 541 |
return str(err) |
542 |
except Exception: # pylint: disable-msg=W0703
|
|
542 |
except Exception: # pylint: disable=W0703 |
|
543 | 543 |
logging.exception("Error while handling existing error %s", err) |
544 | 544 |
return "%s" % str(err) |
545 | 545 |
|
546 | 546 |
|
547 |
def _HandleSigHup(reopen_fn, signum, frame): # pylint: disable-msg=W0613
|
|
547 |
def _HandleSigHup(reopen_fn, signum, frame): # pylint: disable=W0613 |
|
548 | 548 |
"""Handler for SIGHUP. |
549 | 549 |
|
550 | 550 |
@param reopen_fn: List of callback functions for reopening log files |
b/lib/http/__init__.py | ||
---|---|---|
624 | 624 |
|
625 | 625 |
return OpenSSL.SSL.Connection(ctx, sock) |
626 | 626 |
|
627 |
def GetSslCiphers(self): # pylint: disable-msg=R0201
|
|
627 |
def GetSslCiphers(self): # pylint: disable=R0201 |
|
628 | 628 |
"""Returns the ciphers string for SSL. |
629 | 629 |
|
630 | 630 |
""" |
... | ... | |
638 | 638 |
|
639 | 639 |
""" |
640 | 640 |
# some parameters are unused, but this is the API |
641 |
# pylint: disable-msg=W0613
|
|
641 |
# pylint: disable=W0613 |
|
642 | 642 |
assert self._ssl_params, "SSL not initialized" |
643 | 643 |
|
644 | 644 |
return (self._ssl_cert.digest("sha1") == cert.digest("sha1") and |
b/lib/http/auth.py | ||
---|---|---|
92 | 92 |
""" |
93 | 93 |
# today we don't have per-request filtering, but we might want to |
94 | 94 |
# add it in the future |
95 |
# pylint: disable-msg=W0613
|
|
95 |
# pylint: disable=W0613 |
|
96 | 96 |
return self.AUTH_REALM |
97 | 97 |
|
98 | 98 |
def AuthenticationRequired(self, req): |
... | ... | |
106 | 106 |
|
107 | 107 |
""" |
108 | 108 |
# Unused argument, method could be a function |
109 |
# pylint: disable-msg=W0613,R0201
|
|
109 |
# pylint: disable=W0613,R0201 |
|
110 | 110 |
return False |
111 | 111 |
|
112 | 112 |
def PreHandleRequest(self, req): |
b/lib/http/server.py | ||
---|---|---|
537 | 537 |
"""Called for each incoming connection |
538 | 538 |
|
539 | 539 |
""" |
540 |
# pylint: disable-msg=W0212
|
|
540 |
# pylint: disable=W0212 |
|
541 | 541 |
(connection, client_addr) = self.socket.accept() |
542 | 542 |
|
543 | 543 |
self._CollectChildren(False) |
... | ... | |
560 | 560 |
utils.ResetTempfileModule() |
561 | 561 |
|
562 | 562 |
self.request_executor(self, connection, client_addr) |
563 |
except Exception: # pylint: disable-msg=W0703
|
|
563 |
except Exception: # pylint: disable=W0703 |
|
564 | 564 |
logging.exception("Error while handling request from %s:%s", |
565 | 565 |
client_addr[0], client_addr[1]) |
566 | 566 |
os._exit(1) |
b/lib/hypervisor/hv_base.py | ||
---|---|---|
235 | 235 |
""" |
236 | 236 |
raise NotImplementedError |
237 | 237 |
|
238 |
def MigrationInfo(self, instance): # pylint: disable-msg=R0201,W0613
|
|
238 |
def MigrationInfo(self, instance): # pylint: disable=R0201,W0613 |
|
239 | 239 |
"""Get instance information to perform a migration. |
240 | 240 |
|
241 | 241 |
By default assume no information is needed. |
b/lib/hypervisor/hv_chroot.py | ||
---|---|---|
29 | 29 |
import logging |
30 | 30 |
|
31 | 31 |
from ganeti import constants |
32 |
from ganeti import errors # pylint: disable-msg=W0611
|
|
32 |
from ganeti import errors # pylint: disable=W0611 |
|
33 | 33 |
from ganeti import utils |
34 | 34 |
from ganeti import objects |
35 | 35 |
from ganeti.hypervisor import hv_base |
... | ... | |
247 | 247 |
return self.GetLinuxNodeInfo() |
248 | 248 |
|
249 | 249 |
@classmethod |
250 |
def GetInstanceConsole(cls, instance, # pylint: disable-msg=W0221
|
|
250 |
def GetInstanceConsole(cls, instance, # pylint: disable=W0221 |
|
251 | 251 |
hvparams, beparams, root_dir=None): |
252 | 252 |
"""Return information for connecting to the console of an instance. |
253 | 253 |
|
b/lib/hypervisor/hv_lxc.py | ||
---|---|---|
29 | 29 |
import logging |
30 | 30 |
|
31 | 31 |
from ganeti import constants |
32 |
from ganeti import errors # pylint: disable-msg=W0611
|
|
32 |
from ganeti import errors # pylint: disable=W0611 |
|
33 | 33 |
from ganeti import utils |
34 | 34 |
from ganeti import objects |
35 | 35 |
from ganeti.hypervisor import hv_base |
b/lib/jqueue.py | ||
---|---|---|
37 | 37 |
import itertools |
38 | 38 |
|
39 | 39 |
try: |
40 |
# pylint: disable-msg=E0611
|
|
40 |
# pylint: disable=E0611 |
|
41 | 41 |
from pyinotify import pyinotify |
42 | 42 |
except ImportError: |
43 | 43 |
import pyinotify |
... | ... | |
177 | 177 |
@ivar writable: Whether the job is allowed to be modified |
178 | 178 |
|
179 | 179 |
""" |
180 |
# pylint: disable-msg=W0212
|
|
180 |
# pylint: disable=W0212 |
|
181 | 181 |
__slots__ = ["queue", "id", "ops", "log_serial", "ops_iter", "cur_opctx", |
182 | 182 |
"received_timestamp", "start_timestamp", "end_timestamp", |
183 | 183 |
"__weakref__", "processor_lock", "writable"] |
... | ... | |
1048 | 1048 |
logging.exception("%s: Canceling job", opctx.log_prefix) |
1049 | 1049 |
assert op.status == constants.OP_STATUS_CANCELING |
1050 | 1050 |
return (constants.OP_STATUS_CANCELING, None) |
1051 |
except Exception, err: # pylint: disable-msg=W0703
|
|
1051 |
except Exception, err: # pylint: disable=W0703 |
|
1052 | 1052 |
logging.exception("%s: Caught exception in %s", |
1053 | 1053 |
opctx.log_prefix, opctx.summary) |
1054 | 1054 |
return (constants.OP_STATUS_ERROR, _EncodeOpError(err)) |
... | ... | |
1241 | 1241 |
"""The actual job workers. |
1242 | 1242 |
|
1243 | 1243 |
""" |
1244 |
def RunTask(self, job): # pylint: disable-msg=W0221
|
|
1244 |
def RunTask(self, job): # pylint: disable=W0221 |
|
1245 | 1245 |
"""Job executor. |
1246 | 1246 |
|
1247 | 1247 |
@type job: L{_QueuedJob} |
... | ... | |
1358 | 1358 |
self._lock = locking.SharedLock("JobDepMgr") |
1359 | 1359 |
|
1360 | 1360 |
@locking.ssynchronized(_LOCK, shared=1) |
1361 |
def GetLockInfo(self, requested): # pylint: disable-msg=W0613
|
|
1361 |
def GetLockInfo(self, requested): # pylint: disable=W0613 |
|
1362 | 1362 |
"""Retrieves information about waiting jobs. |
1363 | 1363 |
|
1364 | 1364 |
@type requested: set |
... | ... | |
1481 | 1481 |
|
1482 | 1482 |
""" |
1483 | 1483 |
def wrapper(self, *args, **kwargs): |
1484 |
# pylint: disable-msg=W0212
|
|
1484 |
# pylint: disable=W0212 |
|
1485 | 1485 |
assert self._queue_filelock is not None, "Queue should be open" |
1486 | 1486 |
return fn(self, *args, **kwargs) |
1487 | 1487 |
return wrapper |
... | ... | |
1945 | 1945 |
try: |
1946 | 1946 |
data = serializer.LoadJson(raw_data) |
1947 | 1947 |
job = _QueuedJob.Restore(self, data, writable) |
1948 |
except Exception, err: # pylint: disable-msg=W0703
|
|
1948 |
except Exception, err: # pylint: disable=W0703 |
|
1949 | 1949 |
raise errors.JobFileCorrupted(err) |
1950 | 1950 |
|
1951 | 1951 |
return job |
b/lib/locking.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
"""Module implementing the Ganeti locking code.""" |
22 | 22 |
|
23 |
# pylint: disable-msg=W0212
|
|
23 |
# pylint: disable=W0212 |
|
24 | 24 |
|
25 | 25 |
# W0212 since e.g. LockSet methods use (a lot) the internals of |
26 | 26 |
# SharedLock |
... | ... | |
276 | 276 |
if self._nwaiters == 0: |
277 | 277 |
self._Cleanup() |
278 | 278 |
|
279 |
def notifyAll(self): # pylint: disable-msg=C0103
|
|
279 |
def notifyAll(self): # pylint: disable=C0103 |
|
280 | 280 |
"""Close the writing side of the pipe to notify all waiters. |
281 | 281 |
|
282 | 282 |
""" |
... | ... | |
333 | 333 |
self._check_owned() |
334 | 334 |
self._waiters.remove(threading.currentThread()) |
335 | 335 |
|
336 |
def notifyAll(self): # pylint: disable-msg=C0103
|
|
336 |
def notifyAll(self): # pylint: disable=C0103 |
|
337 | 337 |
"""Notify all currently waiting threads. |
338 | 338 |
|
339 | 339 |
""" |
... | ... | |
1507 | 1507 |
# the test cases. |
1508 | 1508 |
return compat.any((self._is_owned(l) for l in LEVELS[level + 1:])) |
1509 | 1509 |
|
1510 |
def _BGL_owned(self): # pylint: disable-msg=C0103
|
|
1510 |
def _BGL_owned(self): # pylint: disable=C0103 |
|
1511 | 1511 |
"""Check if the current thread owns the BGL. |
1512 | 1512 |
|
1513 | 1513 |
Both an exclusive or a shared acquisition work. |
... | ... | |
1516 | 1516 |
return BGL in self.__keyring[LEVEL_CLUSTER]._list_owned() |
1517 | 1517 |
|
1518 | 1518 |
@staticmethod |
1519 |
def _contains_BGL(level, names): # pylint: disable-msg=C0103
|
|
1519 |
def _contains_BGL(level, names): # pylint: disable=C0103 |
|
1520 | 1520 |
"""Check if the level contains the BGL. |
1521 | 1521 |
|
1522 | 1522 |
Check if acting on the given level and set of names will change |
b/lib/luxi.py | ||
---|---|---|
278 | 278 |
logging.error("LUXI request not a dict: %r", msg) |
279 | 279 |
raise ProtocolError("Invalid LUXI request (not a dict)") |
280 | 280 |
|
281 |
method = request.get(KEY_METHOD, None) # pylint: disable-msg=E1103
|
|
282 |
args = request.get(KEY_ARGS, None) # pylint: disable-msg=E1103
|
|
283 |
version = request.get(KEY_VERSION, None) # pylint: disable-msg=E1103
|
|
281 |
method = request.get(KEY_METHOD, None) # pylint: disable=E1103 |
|
282 |
args = request.get(KEY_ARGS, None) # pylint: disable=E1103 |
|
283 |
version = request.get(KEY_VERSION, None) # pylint: disable=E1103 |
|
284 | 284 |
|
285 | 285 |
if method is None or args is None: |
286 | 286 |
logging.error("LUXI request missing method or arguments: %r", msg) |
... | ... | |
309 | 309 |
raise ProtocolError("Invalid response from server: %r" % data) |
310 | 310 |
|
311 | 311 |
return (data[KEY_SUCCESS], data[KEY_RESULT], |
312 |
data.get(KEY_VERSION, None)) # pylint: disable-msg=E1103
|
|
312 |
data.get(KEY_VERSION, None)) # pylint: disable=E1103 |
|
313 | 313 |
|
314 | 314 |
|
315 | 315 |
def FormatResponse(success, result, version=None): |
... | ... | |
417 | 417 |
old_transp = self.transport |
418 | 418 |
self.transport = None |
419 | 419 |
old_transp.Close() |
420 |
except Exception: # pylint: disable-msg=W0703
|
|
420 |
except Exception: # pylint: disable=W0703 |
|
421 | 421 |
pass |
422 | 422 |
|
423 | 423 |
def _SendMethodCall(self, data): |
b/lib/mcpu.py | ||
---|---|---|
122 | 122 |
return timeout |
123 | 123 |
|
124 | 124 |
|
125 |
class OpExecCbBase: # pylint: disable-msg=W0232
|
|
125 |
class OpExecCbBase: # pylint: disable=W0232 |
|
126 | 126 |
"""Base class for OpCode execution callbacks. |
127 | 127 |
|
128 | 128 |
""" |
b/lib/objects.py | ||
---|---|---|
26 | 26 |
|
27 | 27 |
""" |
28 | 28 |
|
29 |
# pylint: disable-msg=E0203,W0201
|
|
29 |
# pylint: disable=E0203,W0201 |
|
30 | 30 |
|
31 | 31 |
# E0203: Access to member %r before its definition, since we use |
32 | 32 |
# objects.py which doesn't explicitely initialise its members |
... | ... | |
170 | 170 |
raise errors.ConfigurationError("Invalid object passed to FromDict:" |
171 | 171 |
" expected dict, got %s" % type(val)) |
172 | 172 |
val_str = dict([(str(k), v) for k, v in val.iteritems()]) |
173 |
obj = cls(**val_str) # pylint: disable-msg=W0142
|
|
173 |
obj = cls(**val_str) # pylint: disable=W0142 |
|
174 | 174 |
return obj |
175 | 175 |
|
176 | 176 |
@staticmethod |
... | ... | |
965 | 965 |
"""Fill defaults for missing configuration values. |
966 | 966 |
|
967 | 967 |
""" |
968 |
# pylint: disable-msg=E0203
|
|
968 |
# pylint: disable=E0203 |
|
969 | 969 |
# because these are "defined" via slots, not manually |
970 | 970 |
if self.master_capable is None: |
971 | 971 |
self.master_capable = True |
... | ... | |
1095 | 1095 |
"""Fill defaults for missing configuration values. |
1096 | 1096 |
|
1097 | 1097 |
""" |
1098 |
# pylint: disable-msg=E0203
|
|
1098 |
# pylint: disable=E0203 |
|
1099 | 1099 |
# because these are "defined" via slots, not manually |
1100 | 1100 |
if self.hvparams is None: |
1101 | 1101 |
self.hvparams = constants.HVC_DEFAULTS |
b/lib/opcodes.py | ||
---|---|---|
31 | 31 |
|
32 | 32 |
# this are practically structures, so disable the message about too |
33 | 33 |
# few public methods: |
34 |
# pylint: disable-msg=R0903
|
|
34 |
# pylint: disable=R0903 |
|
35 | 35 |
|
36 | 36 |
import logging |
37 | 37 |
import re |
... | ... | |
299 | 299 |
field handling. |
300 | 300 |
|
301 | 301 |
""" |
302 |
# pylint: disable-msg=E1101
|
|
302 |
# pylint: disable=E1101 |
|
303 | 303 |
# as OP_ID is dynamically defined |
304 | 304 |
__metaclass__ = _AutoOpParamSlots |
305 | 305 |
|
... | ... | |
473 | 473 |
@ivar priority: Opcode priority for queue |
474 | 474 |
|
475 | 475 |
""" |
476 |
# pylint: disable-msg=E1101
|
|
476 |
# pylint: disable=E1101 |
|
477 | 477 |
# as OP_ID is dynamically defined |
478 | 478 |
WITH_LU = True |
479 | 479 |
OP_PARAMS = [ |
b/lib/qlang.py | ||
---|---|---|
32 | 32 |
""" |
33 | 33 |
|
34 | 34 |
import re |
35 |
import string # pylint: disable-msg=W0402
|
|
35 |
import string # pylint: disable=W0402 |
|
36 | 36 |
import logging |
37 | 37 |
|
38 | 38 |
import pyparsing as pyp |
b/lib/query.py | ||
---|---|---|
137 | 137 |
_SERIAL_NO_DOC = "%s object serial number, incremented on each modification" |
138 | 138 |
|
139 | 139 |
|
140 |
def _GetUnknownField(ctx, item): # pylint: disable-msg=W0613
|
|
140 |
def _GetUnknownField(ctx, item): # pylint: disable=W0613 |
|
141 | 141 |
"""Gets the contents of an unknown field. |
142 | 142 |
|
143 | 143 |
""" |
... | ... | |
260 | 260 |
if op != qlang.OP_OR: |
261 | 261 |
self._NeedAllNames() |
262 | 262 |
|
263 |
def NoteUnaryOp(self, op): # pylint: disable-msg=W0613
|
|
263 |
def NoteUnaryOp(self, op): # pylint: disable=W0613 |
|
264 | 264 |
"""Called when handling an unary operation. |
265 | 265 |
|
266 | 266 |
@type op: string |
... | ... | |
337 | 337 |
"""Converts a query filter to a callable usable for filtering. |
338 | 338 |
|
339 | 339 |
""" |
340 |
# String statement has no effect, pylint: disable-msg=W0105
|
|
340 |
# String statement has no effect, pylint: disable=W0105 |
|
341 | 341 |
|
342 | 342 |
#: How deep filters can be nested |
343 | 343 |
_LEVELS_MAX = 10 |
... | ... | |
546 | 546 |
@param operands: List of operands |
547 | 547 |
|
548 | 548 |
""" |
549 |
# Unused arguments, pylint: disable-msg=W0613
|
|
549 |
# Unused arguments, pylint: disable=W0613 |
|
550 | 550 |
try: |
551 | 551 |
(name, value) = operands |
552 | 552 |
except (ValueError, TypeError): |
... | ... | |
1062 | 1062 |
return fn |
1063 | 1063 |
|
1064 | 1064 |
|
1065 |
def _GetNodeGroup(ctx, node, ng): # pylint: disable-msg=W0613
|
|
1065 |
def _GetNodeGroup(ctx, node, ng): # pylint: disable=W0613 |
|
1066 | 1066 |
"""Returns the name of a node's group. |
1067 | 1067 |
|
1068 | 1068 |
@type ctx: L{NodeQueryData} |
... | ... | |
1408 | 1408 |
return fn |
1409 | 1409 |
|
1410 | 1410 |
|
1411 |
def _GetInstNicIp(ctx, _, nic): # pylint: disable-msg=W0613
|
|
1411 |
def _GetInstNicIp(ctx, _, nic): # pylint: disable=W0613 |
|
1412 | 1412 |
"""Get a NIC's IP address. |
1413 | 1413 |
|
1414 | 1414 |
@type ctx: L{InstanceQueryData} |
b/lib/rapi/baserlib.py | ||
---|---|---|
23 | 23 |
|
24 | 24 |
""" |
25 | 25 |
|
26 |
# pylint: disable-msg=C0103
|
|
26 |
# pylint: disable=C0103 |
|
27 | 27 |
|
28 | 28 |
# C0103: Invalid name, since the R_* names are not conforming |
29 | 29 |
|
... | ... | |
220 | 220 |
params = dict((str(key), value) for (key, value) in params.items()) |
221 | 221 |
|
222 | 222 |
try: |
223 |
op = opcls(**params) # pylint: disable-msg=W0142
|
|
223 |
op = opcls(**params) # pylint: disable=W0142 |
|
224 | 224 |
op.Validate(False) |
225 | 225 |
except (errors.OpPrereqError, TypeError), err: |
226 | 226 |
raise http.HttpBadRequest("Invalid body parameters: %s" % err) |
b/lib/rapi/client.py | ||
---|---|---|
261 | 261 |
return _ConfigCurl |
262 | 262 |
|
263 | 263 |
|
264 |
class GanetiRapiClient(object): # pylint: disable-msg=R0904
|
|
264 |
class GanetiRapiClient(object): # pylint: disable=R0904 |
|
265 | 265 |
"""Ganeti RAPI client. |
266 | 266 |
|
267 | 267 |
""" |
b/lib/rapi/connector.py | ||
---|---|---|
22 | 22 |
|
23 | 23 |
""" |
24 | 24 |
|
25 |
# pylint: disable-msg=C0103
|
|
25 |
# pylint: disable=C0103 |
|
26 | 26 |
|
27 | 27 |
# C0103: Invalid name, since the R_* names are not conforming |
28 | 28 |
|
b/lib/rapi/rlib2.py | ||
---|---|---|
51 | 51 |
|
52 | 52 |
""" |
53 | 53 |
|
54 |
# pylint: disable-msg=C0103
|
|
54 |
# pylint: disable=C0103 |
|
55 | 55 |
|
56 | 56 |
# C0103: Invalid name, since the R_* names are not conforming |
57 | 57 |
|
... | ... | |
1005 | 1005 |
except KeyError: |
1006 | 1006 |
pass |
1007 | 1007 |
else: |
1008 |
if not ht.TListOf(ht.TInt)(raw_disks): # pylint: disable-msg=E1102
|
|
1008 |
if not ht.TListOf(ht.TInt)(raw_disks): # pylint: disable=E1102 |
|
1009 | 1009 |
# Backwards compatibility for strings of the format "1, 2, 3" |
1010 | 1010 |
try: |
1011 | 1011 |
data["disks"] = [int(part) for part in raw_disks.split(",")] |
... | ... | |
1368 | 1368 |
Example: ["tag1", "tag2", "tag3"] |
Also available in: Unified diff