backend: Two small style fixes
[ganeti-local] / lib / rapi / rlib2.py
index 669bae4..f475277 100644 (file)
 
 """
 
 
 """
 
+# 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 import opcodes
 from ganeti import http
 from ganeti import constants
@@ -73,7 +77,8 @@ class R_version(baserlib.R_Generic):
   to adapt clients accordingly.
 
   """
   to adapt clients accordingly.
 
   """
-  def GET(self):
+  @staticmethod
+  def GET():
     """Returns the remote API version.
 
     """
     """Returns the remote API version.
 
     """
@@ -84,7 +89,8 @@ class R_2_info(baserlib.R_Generic):
   """Cluster info.
 
   """
   """Cluster info.
 
   """
-  def GET(self):
+  @staticmethod
+  def GET():
     """Returns cluster information.
 
     """
     """Returns cluster information.
 
     """
@@ -96,7 +102,8 @@ class R_2_os(baserlib.R_Generic):
   """/2/os resource.
 
   """
   """/2/os resource.
 
   """
-  def GET(self):
+  @staticmethod
+  def GET():
     """Return a list of all OSes.
 
     Can return error 500 in case of a problem.
     """Return a list of all OSes.
 
     Can return error 500 in case of a problem.
@@ -127,7 +134,8 @@ class R_2_redist_config(baserlib.R_Generic):
   """/2/redistribute-config resource.
 
   """
   """/2/redistribute-config resource.
 
   """
-  def PUT(self):
+  @staticmethod
+  def PUT():
     """Redistribute configuration to all nodes.
 
     """
     """Redistribute configuration to all nodes.
 
     """
@@ -138,7 +146,8 @@ class R_2_jobs(baserlib.R_Generic):
   """/2/jobs resource.
 
   """
   """/2/jobs resource.
 
   """
-  def GET(self):
+  @staticmethod
+  def GET():
     """Returns a dictionary of jobs.
 
     @return: a dictionary with jobs id and uri.
     """Returns a dictionary of jobs.
 
     @return: a dictionary with jobs id and uri.
@@ -464,6 +473,7 @@ class R_2_instances(baserlib.R_Generic):
       nics=nics,
       start=fn('start', True),
       ip_check=fn('ip_check', True),
       nics=nics,
       start=fn('start', True),
       ip_check=fn('ip_check', True),
+      name_check=fn('name_check', True),
       wait_for_sync=True,
       hypervisor=fn('hypervisor', None),
       hvparams=hvparams,
       wait_for_sync=True,
       hypervisor=fn('hypervisor', None),
       hvparams=hvparams,
@@ -667,6 +677,7 @@ class _R_Tags(baserlib.R_Generic):
     Example: ["tag1", "tag2", "tag3"]
 
     """
     Example: ["tag1", "tag2", "tag3"]
 
     """
+    # pylint: disable-msg=W0212
     return baserlib._Tags_GET(self.TAG_LEVEL, name=self.name)
 
   def PUT(self):
     return baserlib._Tags_GET(self.TAG_LEVEL, name=self.name)
 
   def PUT(self):
@@ -676,6 +687,7 @@ class _R_Tags(baserlib.R_Generic):
     you'll have back a job id.
 
     """
     you'll have back a job id.
 
     """
+    # pylint: disable-msg=W0212
     if 'tag' not in self.queryargs:
       raise http.HttpBadRequest("Please specify tag(s) to add using the"
                                 " the 'tag' parameter")
     if 'tag' not in self.queryargs:
       raise http.HttpBadRequest("Please specify tag(s) to add using the"
                                 " the 'tag' parameter")
@@ -691,6 +703,7 @@ class _R_Tags(baserlib.R_Generic):
     /tags?tag=[tag]&tag=[tag]
 
     """
     /tags?tag=[tag]&tag=[tag]
 
     """
+    # pylint: disable-msg=W0212
     if 'tag' not in self.queryargs:
       # no we not gonna delete all tags
       raise http.HttpBadRequest("Cannot delete all tags - please specify"
     if 'tag' not in self.queryargs:
       # no we not gonna delete all tags
       raise http.HttpBadRequest("Cannot delete all tags - please specify"