# empty file for package definition
+
+"""Ganeti python modules"""
# we need the children open in case the device itself has to
# be assembled
try:
+ # pylint: disable-msg=E1103
crdev.Open()
except errors.BlockDeviceError, err:
errmsg = "Can't make child '%s' read-write: %s" % (child, err)
try:
result = _RecursiveAssembleBD(disk, owner, as_primary)
if isinstance(result, bdev.BlockDev):
+ # pylint: disable-msg=E1103
result = result.dev_path
except errors.BlockDeviceError, err:
result = "Error while assembling disk: %s" % str(err)
"""
if hooks_base_dir is None:
hooks_base_dir = constants.HOOKS_BASE_DIR
- self._BASE_DIR = hooks_base_dir
+ # yeah, _BASE_DIR is not valid for attributes, we use it like a
+ # constant
+ self._BASE_DIR = hooks_base_dir # pylint: disable-msg=C0103
@staticmethod
def ExecHook(script, env):
self.est_time = None
-class BaseDRBD(BlockDev):
+class BaseDRBD(BlockDev): # pylint: disable-msg=W0223
"""Base DRBD class.
This class contains a few bits of common functionality between the
" in order to ensure more consistent results")
-def ARGS_FIXED(val):
+def ARGS_FIXED(val): # pylint: disable-msg=C0103
"""Macro-like function denoting a fixed number of arguments"""
return -val
-def ARGS_ATLEAST(val):
+def ARGS_ATLEAST(val): # pylint: disable-msg=C0103
"""Macro-like function denoting a minimum number of arguments"""
return val
if unitfields is None:
unitfields = []
- numfields = utils.FieldSet(*numfields)
- unitfields = utils.FieldSet(*unitfields)
+ numfields = utils.FieldSet(*numfields) # pylint: disable-msg=W0142
+ unitfields = utils.FieldSet(*unitfields) # pylint: disable-msg=W0142
format_fields = []
for field in fields:
self.recalculate_locks = {}
self.__ssh = None
# logging
- self.LogWarning = processor.LogWarning
- self.LogInfo = processor.LogInfo
+ self.LogWarning = processor.LogWarning # pylint: disable-msg=C0103
+ self.LogInfo = processor.LogInfo # pylint: disable-msg=C0103
for attr_name in self._OP_REQP:
attr_val = getattr(op, attr_name, None)
del self.recalculate_locks[locking.LEVEL_NODE]
-class NoHooksLU(LogicalUnit):
+class NoHooksLU(LogicalUnit): # pylint: disable-msg=W0223
"""Simple LU which runs no hooks.
This LU is intended as a parent for other LogicalUnits which will
" Domain Name.")
-class TagsLU(NoHooksLU):
+class TagsLU(NoHooksLU): # pylint: disable-msg=W0223
"""Generic tags LU.
This is an abstract class which is the parent of all the other tags LUs.
# Do the secret SSL handshake
if self.using_ssl:
- self.sock.set_connect_state()
+ self.sock.set_connect_state() # pylint: disable-msg=E1103
try:
http.Handshake(self.sock, self.WRITE_TIMEOUT)
except http.HttpSessionHandshakeUnexpectedEOF:
if serial is None:
# There must be a serious problem
- raise errors.JobQueueError("Can't read/parse the job queue serial file")
+ raise errors.JobQueueError("Can't read/parse the job queue"
+ " serial file")
if not must_lock:
- # There's no need for more error handling. Closing the lock file below in
- # case of an error will unlock it anyway.
+ # There's no need for more error handling. Closing the lock
+ # file below in case of an error will unlock it anyway.
queue_lock.Unlock()
except:
# the test cases.
return utils.any((self._is_owned(l) for l in LEVELS[level + 1:]))
- def _BGL_owned(self):
+ def _BGL_owned(self): # pylint: disable-msg=C0103
"""Check if the current thread owns the BGL.
Both an exclusive or a shared acquisition work.
"""
return BGL in self.__keyring[LEVEL_CLUSTER]._list_owned()
- def _contains_BGL(self, level, names):
+ def _contains_BGL(self, level, names): # pylint: disable-msg=C0103
"""Check if the level contains the BGL.
Check if acting on the given level and set of names will change
"""
self.context = context
self._feedback_fn = None
- self.exclusive_BGL = False
+ self.exclusive_BGL = False # pylint: disable-msg=C0103
self.rpc = rpc.RpcRunner(context.cfg)
def _ExecLU(self, lu):
"""Fill defaults for missing configuration values.
"""
+ # pylint: disable-msg=E0203
+ # because these are "defined" via slots, not manually
if self.hvparams is None:
self.hvparams = constants.HVC_DEFAULTS
else:
"""
+# pylint: disable-msg=C0103
+
+# C0103: Invalid name, since the R_* names are not conforming
+
import logging
from ganeti import luxi
"""
+# pylint: disable-msg=C0103
+
+# C0103: Invalid name, since the R_* names are not conforming
+
import cgi
import re
"""
+# pylint: disable-msg=C0103
+
+# C0103: Invalid name, since the R_* names are not conforming
+
from ganeti import opcodes
from ganeti import http
from ganeti import constants
from ganeti.rapi import baserlib
-
I_FIELDS = ["name", "admin_state", "os",
"pnode", "snodes",
"disk_template",
from ganeti import constants
from ganeti import errors
-import ganeti.http.client
+# pylint has a bug here, doesn't see this import
+import ganeti.http.client # pylint: disable-msg=W0611
# Module level variable
Must be called before using any RPC function.
"""
- global _http_manager
+ global _http_manager # pylint: disable-msg=W0603
assert not _http_manager, "RPC module initialized more than once"
Must be called before quitting the program.
"""
- global _http_manager
+ global _http_manager # pylint: disable-msg=W0603
if _http_manager:
_http_manager.Shutdown()
backend (currently json).
"""
+# pylint: disable-msg=C0103
+
+# C0103: Invalid name, since pylint doesn't see that Dump points to a
+# function and not a constant
import simplejson
import re