"""Job related commands"""
-# pylint: disable-msg=W0401,W0613,W0614,C0103
+# pylint: disable=W0401,W0613,W0614,C0103
# W0401: Wildcard import ganeti.cli
# W0613: Unused argument, since all functions follow the same API
# W0614: Unused import %s from wildcard import (since we need cli)
#: names
_USER_JOB_STATUS = {
constants.JOB_STATUS_QUEUED: "queued",
- constants.JOB_STATUS_WAITLOCK: "waiting",
+ constants.JOB_STATUS_WAITING: "waiting",
constants.JOB_STATUS_CANCELING: "canceling",
constants.JOB_STATUS_RUNNING: "running",
constants.JOB_STATUS_CANCELED: "canceled",
age = args[0]
- if age == 'all':
+ if age == "all":
age = -1
else:
age = ParseTimespec(age)
commands = {
- 'list': (
+ "list": (
ListJobs, [ArgJobId()],
[NOHDR_OPT, SEP_OPT, FIELDS_OPT],
"[job_id ...]",
" op_status, op_result."
" The default field"
" list is (in order): %s." % utils.CommaJoin(_LIST_DEF_FIELDS)),
- 'archive': (
+ "archive": (
ArchiveJobs, [ArgJobId(min=1)], [],
"<job-id> [<job-id> ...]", "Archive specified jobs"),
- 'autoarchive': (
+ "autoarchive": (
AutoArchiveJobs,
[ArgSuggest(min=1, max=1, choices=["1d", "1w", "4w", "all"])],
[],
"<age>", "Auto archive jobs older than the given age"),
- 'cancel': (
+ "cancel": (
CancelJobs, [ArgJobId(min=1)], [],
"<job-id> [<job-id> ...]", "Cancel specified jobs"),
- 'info': (
+ "info": (
ShowJobs, [ArgJobId(min=1)], [],
"<job-id> [<job-id> ...]",
"Show detailed information about the specified jobs"),
- 'watch': (
+ "watch": (
WatchJob, [ArgJobId(min=1, max=1)], [],
"<job-id>", "Follows a job and prints its output as it arrives"),
}