diff --git a/lib/backend.py b/lib/backend.py index 7de7abbfda96a6d09f45d07ae4558d3f228dcd03..224df1edbb5fcb18221633de065f85a34c630483 100644 --- a/lib/backend.py +++ b/lib/backend.py @@ -2751,7 +2751,8 @@ class IAllocatorRunner(object): the master side. """ - def Run(self, name, idata): + @staticmethod + def Run(name, idata): """Run an iallocator script. @type name: str diff --git a/lib/cmdlib.py b/lib/cmdlib.py index 978bacf2593aa410ff2b411911fa4c019a7b8110..f5762ef8b670d5aa89645221ebb3fd783adaf940 100644 --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -7607,7 +7607,8 @@ class LUSetInstanceParams(LogicalUnit): nl = [self.cfg.GetMasterNode()] + list(self.instance.all_nodes) return env, nl, nl - def _GetUpdatedParams(self, old_params, update_dict, + @staticmethod + def _GetUpdatedParams(old_params, update_dict, default_values, parameter_types): """Return the new params dict for the given params. diff --git a/lib/http/__init__.py b/lib/http/__init__.py index c6e9ee0f6489460e6224171c8d8bd808f47ba4a5..d00aba48fe1c3cd5cc1b7ee8c4be8d47b9d1dcbc 100644 --- a/lib/http/__init__.py +++ b/lib/http/__init__.py @@ -302,10 +302,12 @@ class HttpVersionNotSupported(HttpException): class HttpJsonConverter: # pylint: disable-msg=W0232 CONTENT_TYPE = "application/json" - def Encode(self, data): + @staticmethod + def Encode(data): return serializer.DumpJson(data) - def Decode(self, data): + @staticmethod + def Decode(data): return serializer.LoadJson(data) diff --git a/lib/jqueue.py b/lib/jqueue.py index 25f464e489ef954f0726b7711ffc084062444b89..ec2f52a18cb9a456d43a903b6d4c36c76ee474da 100644 --- a/lib/jqueue.py +++ b/lib/jqueue.py @@ -725,7 +725,8 @@ class JobQueue(object): except KeyError: pass - def _CheckRpcResult(self, result, nodes, failmsg): + @staticmethod + def _CheckRpcResult(result, nodes, failmsg): """Verifies the status of an RPC call. Since we aim to keep consistency should this node (the current @@ -806,7 +807,8 @@ class JobQueue(object): result = rpc.RpcRunner.call_jobqueue_rename(names, addrs, rename) self._CheckRpcResult(result, self._nodes, "Renaming files (%r)" % rename) - def _FormatJobID(self, job_id): + @staticmethod + def _FormatJobID(job_id): """Convert a job ID to string format. Currently this just does C{str(job_id)} after performing some @@ -1344,7 +1346,8 @@ class JobQueue(object): return (archived_count, len(all_job_ids) - last_touched - 1) - def _GetJobInfoUnlocked(self, job, fields): + @staticmethod + def _GetJobInfoUnlocked(job, fields): """Returns information about a job. @type job: L{_QueuedJob} diff --git a/lib/rapi/connector.py b/lib/rapi/connector.py index aba95b7c57bcdfa72140648df0c390605f4b7c0e..bc9bb8cf62f57e79e522d8453487710c3353b029 100644 --- a/lib/rapi/connector.py +++ b/lib/rapi/connector.py @@ -99,7 +99,8 @@ class R_root(baserlib.R_Generic): """/ resource. """ - def GET(self): + @staticmethod + def GET(): """Show the list of mapped resources. @return: a dictionary with 'name' and 'uri' keys for each of them. @@ -142,7 +143,8 @@ class R_2(baserlib.R_Generic): """ /2 resource, the root of the version 2 API. """ - def GET(self): + @staticmethod + def GET(): """Show the list of mapped resources. @return: a dictionary with 'name' and 'uri' keys for each of them. diff --git a/lib/rapi/rlib2.py b/lib/rapi/rlib2.py index 934abe3be284cb4b0aae06f9dd6820b5d02341f1..f475277578fc7dc8dd560046b9a69b2f4e695c2f 100644 --- a/lib/rapi/rlib2.py +++ b/lib/rapi/rlib2.py @@ -77,7 +77,8 @@ class R_version(baserlib.R_Generic): to adapt clients accordingly. """ - def GET(self): + @staticmethod + def GET(): """Returns the remote API version. """ @@ -88,7 +89,8 @@ class R_2_info(baserlib.R_Generic): """Cluster info. """ - def GET(self): + @staticmethod + def GET(): """Returns cluster information. """ @@ -100,7 +102,8 @@ class R_2_os(baserlib.R_Generic): """/2/os resource. """ - def GET(self): + @staticmethod + def GET(): """Return a list of all OSes. Can return error 500 in case of a problem. @@ -131,7 +134,8 @@ class R_2_redist_config(baserlib.R_Generic): """/2/redistribute-config resource. """ - def PUT(self): + @staticmethod + def PUT(): """Redistribute configuration to all nodes. """ @@ -142,7 +146,8 @@ class R_2_jobs(baserlib.R_Generic): """/2/jobs resource. """ - def GET(self): + @staticmethod + def GET(): """Returns a dictionary of jobs. @return: a dictionary with jobs id and uri. diff --git a/tools/burnin b/tools/burnin index b566df8c277ab730fce46fce1b68a4723030b729..8adad917ab2e8b8261af9c6e0cc80a02828aded8 100755 --- a/tools/burnin +++ b/tools/burnin @@ -675,15 +675,18 @@ class Burner(object): Log("remove export", indent=2) self.ExecOrQueue(instance, exp_op, rem_op, imp_op, erem_op) - def StopInstanceOp(self, instance): + @staticmethod + def StopInstanceOp(instance): """Stop given instance.""" return opcodes.OpShutdownInstance(instance_name=instance) - def StartInstanceOp(self, instance): + @staticmethod + def StartInstanceOp(instance): """Start given instance.""" return opcodes.OpStartupInstance(instance_name=instance, force=False) - def RenameInstanceOp(self, instance, instance_new): + @staticmethod + def RenameInstanceOp(instance, instance_new): """Rename instance.""" return opcodes.OpRenameInstance(instance_name=instance, new_name=instance_new) diff --git a/tools/cfgshell b/tools/cfgshell index b3d59689df967ad27ec1c876def76176ce1c562f..62e501df1580a3705d19a34baa305a1df50ba777 100755 --- a/tools/cfgshell +++ b/tools/cfgshell @@ -309,14 +309,16 @@ class ConfigShell(cmd.Cmd): else: print "Invalid node name" - def do_EOF(self, line): + @staticmethod + def do_EOF(line): """Exit the application. """ print return True - def do_quit(self, line): + @staticmethod + def do_quit(line): """Exit the application. """