Merge branch 'devel-2.1' into stable-2.1
[ganeti-local] / lib / storage.py
index 7f73100..5d30396 100644 (file)
 
 """
 
 
 """
 
+# pylint: disable-msg=W0232,R0201
+
+# W0232, since we use these as singletons rather than object holding
+# data
+
+# R0201, for the same reason
+
+# TODO: FileStorage initialised with paths whereas the others not
 
 import logging
 
 
 import logging
 
@@ -50,7 +58,7 @@ class _Base:
     """
     raise NotImplementedError()
 
     """
     raise NotImplementedError()
 
-  def Modify(self, name, changes):
+  def Modify(self, name, changes): # pylint: disable-msg=W0613
     """Modifies an entity within the storage unit.
 
     @type name: string
     """Modifies an entity within the storage unit.
 
     @type name: string
@@ -76,7 +84,7 @@ class _Base:
     raise NotImplementedError()
 
 
     raise NotImplementedError()
 
 
-class FileStorage(_Base):
+class FileStorage(_Base): # pylint: disable-msg=W0223
   """File storage unit.
 
   """
   """File storage unit.
 
   """
@@ -153,7 +161,7 @@ class FileStorage(_Base):
     return values
 
 
     return values
 
 
-class _LvmBase(_Base):
+class _LvmBase(_Base): # pylint: disable-msg=W0223
   """Base class for LVM storage containers.
 
   @cvar LIST_FIELDS: list of tuples consisting of three elements: SF_*
   """Base class for LVM storage containers.
 
   @cvar LIST_FIELDS: list of tuples consisting of three elements: SF_*
@@ -248,7 +256,7 @@ class _LvmBase(_Base):
 
         if callable(mapper):
           # we got a function, call it with all the declared fields
 
         if callable(mapper):
           # we got a function, call it with all the declared fields
-          val = mapper(*values)
+          val = mapper(*values) # pylint: disable-msg=W0142
         elif len(values) == 1:
           # we don't have a function, but we had a single field
           # declared, pass it unchanged
         elif len(values) == 1:
           # we don't have a function, but we had a single field
           # declared, pass it unchanged
@@ -324,10 +332,11 @@ class _LvmBase(_Base):
       yield fields
 
 
       yield fields
 
 
-class LvmPvStorage(_LvmBase):
+class LvmPvStorage(_LvmBase): # pylint: disable-msg=W0223
   """LVM Physical Volume storage unit.
 
   """
   """LVM Physical Volume storage unit.
 
   """
+  @staticmethod
   def _GetAllocatable(attr):
     if attr:
       return (attr[0] == "a")
   def _GetAllocatable(attr):
     if attr:
       return (attr[0] == "a")