Revision fe267188
b/lib/__init__.py | ||
---|---|---|
20 | 20 |
|
21 | 21 |
|
22 | 22 |
# empty file for package definition |
23 |
|
|
24 |
"""Ganeti python modules""" |
b/lib/backend.py | ||
---|---|---|
1151 | 1151 |
# we need the children open in case the device itself has to |
1152 | 1152 |
# be assembled |
1153 | 1153 |
try: |
1154 |
# pylint: disable-msg=E1103 |
|
1154 | 1155 |
crdev.Open() |
1155 | 1156 |
except errors.BlockDeviceError, err: |
1156 | 1157 |
errmsg = "Can't make child '%s' read-write: %s" % (child, err) |
... | ... | |
1297 | 1298 |
try: |
1298 | 1299 |
result = _RecursiveAssembleBD(disk, owner, as_primary) |
1299 | 1300 |
if isinstance(result, bdev.BlockDev): |
1301 |
# pylint: disable-msg=E1103 |
|
1300 | 1302 |
result = result.dev_path |
1301 | 1303 |
except errors.BlockDeviceError, err: |
1302 | 1304 |
result = "Error while assembling disk: %s" % str(err) |
... | ... | |
2510 | 2512 |
""" |
2511 | 2513 |
if hooks_base_dir is None: |
2512 | 2514 |
hooks_base_dir = constants.HOOKS_BASE_DIR |
2513 |
self._BASE_DIR = hooks_base_dir |
|
2515 |
# yeah, _BASE_DIR is not valid for attributes, we use it like a |
|
2516 |
# constant |
|
2517 |
self._BASE_DIR = hooks_base_dir # pylint: disable-msg=C0103 |
|
2514 | 2518 |
|
2515 | 2519 |
@staticmethod |
2516 | 2520 |
def ExecHook(script, env): |
b/lib/bdev.py | ||
---|---|---|
720 | 720 |
self.est_time = None |
721 | 721 |
|
722 | 722 |
|
723 |
class BaseDRBD(BlockDev): |
|
723 |
class BaseDRBD(BlockDev): # pylint: disable-msg=W0223
|
|
724 | 724 |
"""Base DRBD class. |
725 | 725 |
|
726 | 726 |
This class contains a few bits of common functionality between the |
b/lib/cli.py | ||
---|---|---|
198 | 198 |
" in order to ensure more consistent results") |
199 | 199 |
|
200 | 200 |
|
201 |
def ARGS_FIXED(val): |
|
201 |
def ARGS_FIXED(val): # pylint: disable-msg=C0103
|
|
202 | 202 |
"""Macro-like function denoting a fixed number of arguments""" |
203 | 203 |
return -val |
204 | 204 |
|
205 | 205 |
|
206 |
def ARGS_ATLEAST(val): |
|
206 |
def ARGS_ATLEAST(val): # pylint: disable-msg=C0103
|
|
207 | 207 |
"""Macro-like function denoting a minimum number of arguments""" |
208 | 208 |
return val |
209 | 209 |
|
... | ... | |
797 | 797 |
if unitfields is None: |
798 | 798 |
unitfields = [] |
799 | 799 |
|
800 |
numfields = utils.FieldSet(*numfields) |
|
801 |
unitfields = utils.FieldSet(*unitfields) |
|
800 |
numfields = utils.FieldSet(*numfields) # pylint: disable-msg=W0142
|
|
801 |
unitfields = utils.FieldSet(*unitfields) # pylint: disable-msg=W0142
|
|
802 | 802 |
|
803 | 803 |
format_fields = [] |
804 | 804 |
for field in fields: |
b/lib/cmdlib.py | ||
---|---|---|
84 | 84 |
self.recalculate_locks = {} |
85 | 85 |
self.__ssh = None |
86 | 86 |
# logging |
87 |
self.LogWarning = processor.LogWarning |
|
88 |
self.LogInfo = processor.LogInfo |
|
87 |
self.LogWarning = processor.LogWarning # pylint: disable-msg=C0103
|
|
88 |
self.LogInfo = processor.LogInfo # pylint: disable-msg=C0103
|
|
89 | 89 |
|
90 | 90 |
for attr_name in self._OP_REQP: |
91 | 91 |
attr_val = getattr(op, attr_name, None) |
... | ... | |
322 | 322 |
del self.recalculate_locks[locking.LEVEL_NODE] |
323 | 323 |
|
324 | 324 |
|
325 |
class NoHooksLU(LogicalUnit): |
|
325 |
class NoHooksLU(LogicalUnit): # pylint: disable-msg=W0223
|
|
326 | 326 |
"""Simple LU which runs no hooks. |
327 | 327 |
|
328 | 328 |
This LU is intended as a parent for other LogicalUnits which will |
... | ... | |
6635 | 6635 |
" Domain Name.") |
6636 | 6636 |
|
6637 | 6637 |
|
6638 |
class TagsLU(NoHooksLU): |
|
6638 |
class TagsLU(NoHooksLU): # pylint: disable-msg=W0223
|
|
6639 | 6639 |
"""Generic tags LU. |
6640 | 6640 |
|
6641 | 6641 |
This is an abstract class which is the parent of all the other tags LUs. |
b/lib/http/client.py | ||
---|---|---|
254 | 254 |
|
255 | 255 |
# Do the secret SSL handshake |
256 | 256 |
if self.using_ssl: |
257 |
self.sock.set_connect_state() |
|
257 |
self.sock.set_connect_state() # pylint: disable-msg=E1103
|
|
258 | 258 |
try: |
259 | 259 |
http.Handshake(self.sock, self.WRITE_TIMEOUT) |
260 | 260 |
except http.HttpSessionHandshakeUnexpectedEOF: |
b/lib/jstore.py | ||
---|---|---|
130 | 130 |
|
131 | 131 |
if serial is None: |
132 | 132 |
# There must be a serious problem |
133 |
raise errors.JobQueueError("Can't read/parse the job queue serial file") |
|
133 |
raise errors.JobQueueError("Can't read/parse the job queue" |
|
134 |
" serial file") |
|
134 | 135 |
|
135 | 136 |
if not must_lock: |
136 |
# There's no need for more error handling. Closing the lock file below in
|
|
137 |
# case of an error will unlock it anyway. |
|
137 |
# There's no need for more error handling. Closing the lock |
|
138 |
# file below in case of an error will unlock it anyway.
|
|
138 | 139 |
queue_lock.Unlock() |
139 | 140 |
|
140 | 141 |
except: |
b/lib/locking.py | ||
---|---|---|
753 | 753 |
# the test cases. |
754 | 754 |
return utils.any((self._is_owned(l) for l in LEVELS[level + 1:])) |
755 | 755 |
|
756 |
def _BGL_owned(self): |
|
756 |
def _BGL_owned(self): # pylint: disable-msg=C0103
|
|
757 | 757 |
"""Check if the current thread owns the BGL. |
758 | 758 |
|
759 | 759 |
Both an exclusive or a shared acquisition work. |
... | ... | |
761 | 761 |
""" |
762 | 762 |
return BGL in self.__keyring[LEVEL_CLUSTER]._list_owned() |
763 | 763 |
|
764 |
def _contains_BGL(self, level, names): |
|
764 |
def _contains_BGL(self, level, names): # pylint: disable-msg=C0103
|
|
765 | 765 |
"""Check if the level contains the BGL. |
766 | 766 |
|
767 | 767 |
Check if acting on the given level and set of names will change |
b/lib/mcpu.py | ||
---|---|---|
100 | 100 |
""" |
101 | 101 |
self.context = context |
102 | 102 |
self._feedback_fn = None |
103 |
self.exclusive_BGL = False |
|
103 |
self.exclusive_BGL = False # pylint: disable-msg=C0103
|
|
104 | 104 |
self.rpc = rpc.RpcRunner(context.cfg) |
105 | 105 |
|
106 | 106 |
def _ExecLU(self, lu): |
b/lib/objects.py | ||
---|---|---|
786 | 786 |
"""Fill defaults for missing configuration values. |
787 | 787 |
|
788 | 788 |
""" |
789 |
# pylint: disable-msg=E0203 |
|
790 |
# because these are "defined" via slots, not manually |
|
789 | 791 |
if self.hvparams is None: |
790 | 792 |
self.hvparams = constants.HVC_DEFAULTS |
791 | 793 |
else: |
b/lib/rapi/baserlib.py | ||
---|---|---|
23 | 23 |
|
24 | 24 |
""" |
25 | 25 |
|
26 |
# pylint: disable-msg=C0103 |
|
27 |
|
|
28 |
# C0103: Invalid name, since the R_* names are not conforming |
|
29 |
|
|
26 | 30 |
import logging |
27 | 31 |
|
28 | 32 |
from ganeti import luxi |
b/lib/rapi/connector.py | ||
---|---|---|
22 | 22 |
|
23 | 23 |
""" |
24 | 24 |
|
25 |
# pylint: disable-msg=C0103 |
|
26 |
|
|
27 |
# C0103: Invalid name, since the R_* names are not conforming |
|
28 |
|
|
25 | 29 |
import cgi |
26 | 30 |
import re |
27 | 31 |
|
b/lib/rapi/rlib2.py | ||
---|---|---|
23 | 23 |
|
24 | 24 |
""" |
25 | 25 |
|
26 |
# pylint: disable-msg=C0103 |
|
27 |
|
|
28 |
# C0103: Invalid name, since the R_* names are not conforming |
|
29 |
|
|
26 | 30 |
from ganeti import opcodes |
27 | 31 |
from ganeti import http |
28 | 32 |
from ganeti import constants |
... | ... | |
30 | 34 |
from ganeti.rapi import baserlib |
31 | 35 |
|
32 | 36 |
|
33 |
|
|
34 | 37 |
I_FIELDS = ["name", "admin_state", "os", |
35 | 38 |
"pnode", "snodes", |
36 | 39 |
"disk_template", |
b/lib/rpc.py | ||
---|---|---|
42 | 42 |
from ganeti import constants |
43 | 43 |
from ganeti import errors |
44 | 44 |
|
45 |
import ganeti.http.client |
|
45 |
# pylint has a bug here, doesn't see this import |
|
46 |
import ganeti.http.client # pylint: disable-msg=W0611 |
|
46 | 47 |
|
47 | 48 |
|
48 | 49 |
# Module level variable |
... | ... | |
55 | 56 |
Must be called before using any RPC function. |
56 | 57 |
|
57 | 58 |
""" |
58 |
global _http_manager |
|
59 |
global _http_manager # pylint: disable-msg=W0603
|
|
59 | 60 |
|
60 | 61 |
assert not _http_manager, "RPC module initialized more than once" |
61 | 62 |
|
... | ... | |
68 | 69 |
Must be called before quitting the program. |
69 | 70 |
|
70 | 71 |
""" |
71 |
global _http_manager |
|
72 |
global _http_manager # pylint: disable-msg=W0603
|
|
72 | 73 |
|
73 | 74 |
if _http_manager: |
74 | 75 |
_http_manager.Shutdown() |
b/lib/serializer.py | ||
---|---|---|
24 | 24 |
backend (currently json). |
25 | 25 |
|
26 | 26 |
""" |
27 |
# pylint: disable-msg=C0103 |
|
28 |
|
|
29 |
# C0103: Invalid name, since pylint doesn't see that Dump points to a |
|
30 |
# function and not a constant |
|
27 | 31 |
|
28 | 32 |
import simplejson |
29 | 33 |
import re |
Also available in: Unified diff