Skip to content

Commit cf89676

Browse files
committed
flux-job: use lookup with CURRENT flag
Problem: The job-info.update-lookup target is being deprecated over the job-info.lookup target w/ the CURRENT flag. The "flux job info" command uses the job-info.update-lookup target. Update to use job-info.lookup over job-info.update-lookup. Fallback to job-info.update-lookup if necessary.
1 parent 3a0c75b commit cf89676

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/cmd/flux-job.c

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3427,23 +3427,19 @@ int cmd_info (optparse_t *p, int argc, char **argv)
34273427
val = new_val = reconstruct_current_jobspec (jobspec, eventlog);
34283428
}
34293429
/* The current (non --base) R is obtained through the
3430-
* job-info.update-lookup RPC, not the normal job-info.lookup.
3430+
* job-info.lookup RPC w/ the CURRENT flag.
34313431
*/
34323432
else if (!optparse_hasopt (p, "base") && streq (key, "R")) {
3433-
json_t *o;
34343433
if (!(f = flux_rpc_pack (h,
3435-
"job-info.update-lookup",
3434+
"job-info.lookup",
34363435
FLUX_NODEID_ANY,
34373436
0,
3438-
"{s:I s:s s:i}",
3437+
"{s:I s:[s] s:i}",
34393438
"id", id,
3440-
"key", key,
3441-
"flags", 0))
3442-
|| flux_rpc_get_unpack (f, "{s:o}", key, &o) < 0)
3439+
"keys", key,
3440+
"flags", FLUX_JOB_LOOKUP_CURRENT))
3441+
|| flux_rpc_get_unpack (f, "{s:s}", key, &val) < 0)
34433442
log_msg_exit ("%s", future_strerror (f, errno));
3444-
if (!(new_val = json_dumps (o, JSON_COMPACT)))
3445-
log_msg_exit ("error encoding R object");
3446-
val = new_val;
34473443
}
34483444
/* All other keys are obtained this way.
34493445
*/

0 commit comments

Comments
 (0)