Skip to content

Commit d3ff8a0

Browse files
chu11mergify[bot]
authored andcommitted
cmd/flux-job: use new job-list all attribute
Problem: There is no need to maintain the long list of job attributes to retrieve from job-list now that there is the job-list 'all' attribute. Solution: Use the all attribute with all job-list related commands.
1 parent bbdb721 commit d3ff8a0

File tree

1 file changed

+3
-11
lines changed

1 file changed

+3
-11
lines changed

src/cmd/flux-job.c

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1092,14 +1092,6 @@ int cmd_cancelall (optparse_t *p, int argc, char **argv)
10921092
return 0;
10931093
}
10941094

1095-
static const char *list_attrs =
1096-
"[\"userid\",\"urgency\",\"priority\",\"t_submit\",\"state\"," \
1097-
"\"name\",\"ntasks\",\"nnodes\",\"ranks\",\"nodelist\",\"expiration\"," \
1098-
"\"success\",\"exception_occurred\",\"exception_severity\"," \
1099-
"\"exception_type\",\"exception_note\",\"result\",\"waitstatus\"," \
1100-
"\"t_depend\",\"t_run\",\"t_cleanup\"," \
1101-
"\"t_inactive\",\"annotations\",\"dependencies\"]";
1102-
11031095
int cmd_list (optparse_t *p, int argc, char **argv)
11041096
{
11051097
int optindex = optparse_option_index (p);
@@ -1133,7 +1125,7 @@ int cmd_list (optparse_t *p, int argc, char **argv)
11331125
else
11341126
userid = getuid ();
11351127

1136-
if (!(f = flux_job_list (h, max_entries, list_attrs, userid, states)))
1128+
if (!(f = flux_job_list (h, max_entries, "[\"all\"]", userid, states)))
11371129
log_err_exit ("flux_job_list");
11381130
if (flux_rpc_get_unpack (f, "{s:o}", "jobs", &jobs) < 0)
11391131
log_err_exit ("flux_job_list");
@@ -1169,7 +1161,7 @@ int cmd_list_inactive (optparse_t *p, int argc, char **argv)
11691161
if (!(h = flux_open (NULL, 0)))
11701162
log_err_exit ("flux_open");
11711163

1172-
if (!(f = flux_job_list_inactive (h, max_entries, since, list_attrs)))
1164+
if (!(f = flux_job_list_inactive (h, max_entries, since, "[\"all\"]")))
11731165
log_err_exit ("flux_job_list_inactive");
11741166
if (flux_rpc_get_unpack (f, "{s:o}", "jobs", &jobs) < 0)
11751167
log_err_exit ("flux_job_list_inactive");
@@ -1218,7 +1210,7 @@ int cmd_list_ids (optparse_t *p, int argc, char **argv)
12181210
for (i = 0; i < ids_len; i++) {
12191211
flux_jobid_t id = parse_jobid (argv[optindex + i]);
12201212
flux_future_t *f;
1221-
if (!(f = flux_job_list_id (h, id, list_attrs)))
1213+
if (!(f = flux_job_list_id (h, id, "[\"all\"]")))
12221214
log_err_exit ("flux_job_list_id");
12231215
if (flux_future_then (f, -1, list_id_continuation, NULL) < 0)
12241216
log_err_exit ("flux_future_then");

0 commit comments

Comments
 (0)