Revision 0ad64cf8 scripts/gnt-job
b/scripts/gnt-job | ||
---|---|---|
43 | 43 |
constants.JOB_STATUS_ERROR: "error", |
44 | 44 |
} |
45 | 45 |
|
46 |
|
|
46 | 47 |
def ListJobs(opts, args): |
47 | 48 |
"""List the jobs |
48 | 49 |
|
... | ... | |
92 | 93 |
return 0 |
93 | 94 |
|
94 | 95 |
|
96 |
def ArchiveJobs(opts, args): |
|
97 |
client = GetClient() |
|
98 |
|
|
99 |
for job_id in args: |
|
100 |
client.ArchiveJob(job_id) |
|
101 |
|
|
102 |
return 0 |
|
103 |
|
|
104 |
|
|
95 | 105 |
commands = { |
96 | 106 |
'list': (ListJobs, ARGS_NONE, |
97 | 107 |
[DEBUG_OPT, NOHDR_OPT, SEP_OPT, USEUNITS_OPT, FIELDS_OPT], |
... | ... | |
99 | 109 |
" (see the man page for details): id, status, op_list," |
100 | 110 |
" op_status, op_result." |
101 | 111 |
" The default field" |
102 |
" list is (in order): %s." % ", ".join(_LIST_DEF_FIELDS)) |
|
112 |
" list is (in order): %s." % ", ".join(_LIST_DEF_FIELDS)), |
|
113 |
'archive': (ArchiveJobs, ARGS_ANY, |
|
114 |
[DEBUG_OPT], |
|
115 |
"<job-id> [<job-id> ...]", |
|
116 |
"Archive specified jobs"), |
|
103 | 117 |
} |
104 | 118 |
|
105 | 119 |
|
Also available in: Unified diff