Correct capitalisation of two Luxi calls
authorIustin Pop <iustin@google.com>
Sat, 5 May 2012 03:42:48 +0000 (05:42 +0200)
committerIustin Pop <iustin@google.com>
Tue, 8 May 2012 10:37:48 +0000 (12:37 +0200)
Two Luxi calls have inconsistent an name/value mapping (in the Python
code):

- REQ_AUTOARCHIVE_JOBS versus AutoArchiveJobs (versus AutoarchiveJobs)
- REQ_QUEUE_SET_DRAIN_FLAG versus SetDrainFlag (no Queue)

While these are only a consistency issue, let's fix them so that the
Haskell code (which uses the auto-generated camel-case form) doesn't
need to handle them case specially, and looks more like the Python
code (hah, joke!).

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: RenĂ© Nussbaumer <rn@google.com>

lib/luxi.py
lib/server/masterd.py
test/ganeti.rapi.testutils_unittest.py

index 3592815..5799d40 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2006, 2007, 2011 Google Inc.
+# Copyright (C) 2006, 2007, 2011, 2012 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -53,7 +53,7 @@ REQ_SUBMIT_MANY_JOBS = "SubmitManyJobs"
 REQ_WAIT_FOR_JOB_CHANGE = "WaitForJobChange"
 REQ_CANCEL_JOB = "CancelJob"
 REQ_ARCHIVE_JOB = "ArchiveJob"
-REQ_AUTOARCHIVE_JOBS = "AutoArchiveJobs"
+REQ_AUTO_ARCHIVE_JOBS = "AutoArchiveJobs"
 REQ_QUERY = "Query"
 REQ_QUERY_FIELDS = "QueryFields"
 REQ_QUERY_JOBS = "QueryJobs"
@@ -64,13 +64,13 @@ REQ_QUERY_EXPORTS = "QueryExports"
 REQ_QUERY_CONFIG_VALUES = "QueryConfigValues"
 REQ_QUERY_CLUSTER_INFO = "QueryClusterInfo"
 REQ_QUERY_TAGS = "QueryTags"
-REQ_QUEUE_SET_DRAIN_FLAG = "SetDrainFlag"
+REQ_SET_DRAIN_FLAG = "SetDrainFlag"
 REQ_SET_WATCHER_PAUSE = "SetWatcherPause"
 
 #: List of all LUXI requests
 REQ_ALL = frozenset([
   REQ_ARCHIVE_JOB,
-  REQ_AUTOARCHIVE_JOBS,
+  REQ_AUTO_ARCHIVE_JOBS,
   REQ_CANCEL_JOB,
   REQ_QUERY,
   REQ_QUERY_CLUSTER_INFO,
@@ -82,7 +82,7 @@ REQ_ALL = frozenset([
   REQ_QUERY_JOBS,
   REQ_QUERY_NODES,
   REQ_QUERY_TAGS,
-  REQ_QUEUE_SET_DRAIN_FLAG,
+  REQ_SET_DRAIN_FLAG,
   REQ_SET_WATCHER_PAUSE,
   REQ_SUBMIT_JOB,
   REQ_SUBMIT_MANY_JOBS,
@@ -466,7 +466,7 @@ class Client(object):
                           version=constants.LUXI_VERSION)
 
   def SetQueueDrainFlag(self, drain_flag):
-    return self.CallMethod(REQ_QUEUE_SET_DRAIN_FLAG, (drain_flag, ))
+    return self.CallMethod(REQ_SET_DRAIN_FLAG, (drain_flag, ))
 
   def SetWatcherPause(self, until):
     return self.CallMethod(REQ_SET_WATCHER_PAUSE, (until, ))
@@ -489,7 +489,7 @@ class Client(object):
 
   def AutoArchiveJobs(self, age):
     timeout = (DEF_RWTO - 1) / 2
-    return self.CallMethod(REQ_AUTOARCHIVE_JOBS, (age, timeout))
+    return self.CallMethod(REQ_AUTO_ARCHIVE_JOBS, (age, timeout))
 
   def WaitForJobChangeOnce(self, job_id, fields,
                            prev_job_info, prev_log_serial,
index ee3a12e..94c60f4 100644 (file)
@@ -1,7 +1,7 @@
 #
 #
 
-# Copyright (C) 2006, 2007, 2010, 2011 Google Inc.
+# Copyright (C) 2006, 2007, 2010, 2011, 2012 Google Inc.
 #
 # This program is free software; you can redistribute it and/or modify
 # it under the terms of the GNU General Public License as published by
@@ -288,7 +288,7 @@ class ClientOps:
       logging.info("Received job archive request for %s", job_id)
       return queue.ArchiveJob(job_id)
 
-    elif method == luxi.REQ_AUTOARCHIVE_JOBS:
+    elif method == luxi.REQ_AUTO_ARCHIVE_JOBS:
       (age, timeout) = args
       logging.info("Received job autoarchive request for age %s, timeout %s",
                    age, timeout)
@@ -396,7 +396,7 @@ class ClientOps:
       op = opcodes.OpTagsGet(kind=kind, name=name, use_locking=False)
       return self._Query(op)
 
-    elif method == luxi.REQ_QUEUE_SET_DRAIN_FLAG:
+    elif method == luxi.REQ_SET_DRAIN_FLAG:
       (drain_flag, ) = args
       logging.info("Received queue drain flag change request to %s",
                    drain_flag)
index 8d68b03..53dcaa7 100755 (executable)
@@ -40,11 +40,11 @@ import testutils
 KNOWN_UNUSED_LUXI = frozenset([
   luxi.REQ_SUBMIT_MANY_JOBS,
   luxi.REQ_ARCHIVE_JOB,
-  luxi.REQ_AUTOARCHIVE_JOBS,
+  luxi.REQ_AUTO_ARCHIVE_JOBS,
   luxi.REQ_QUERY_EXPORTS,
   luxi.REQ_QUERY_CONFIG_VALUES,
   luxi.REQ_QUERY_TAGS,
-  luxi.REQ_QUEUE_SET_DRAIN_FLAG,
+  luxi.REQ_SET_DRAIN_FLAG,
   luxi.REQ_SET_WATCHER_PAUSE,
   ])