Commit 83c046a2 authored by Iustin Pop's avatar Iustin Pop
Browse files

Correct capitalisation of two Luxi calls



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: default avatarIustin Pop <iustin@google.com>
Reviewed-by: default avatarRené Nussbaumer <rn@google.com>
parent 3ad57194
#
#
# 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,
......
#
#
# 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)
......
......@@ -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,
])
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment