Skip to content

Commit fd67007

Browse files
committed
resource: exclude: remove unnecessary use of flux_log_error()
Problem: When inventory_targets_to_ranks() fails, flux_log_error() is used, even though a textual error is already available in error.text. Use flux_log() instead to avoid useless strerror() string appended to error message. Update one test that expected the sterror.
1 parent 74ff7b6 commit fd67007

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/modules/resource/exclude.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,10 +64,11 @@ struct exclude *exclude_create (struct resource_ctx *ctx,
6464
if (!(exclude->idset = inventory_targets_to_ranks (ctx->inventory,
6565
exclude_idset,
6666
&error))) {
67-
flux_log_error (ctx->h,
68-
"error decoding exclude set %s: %s",
69-
exclude_idset,
70-
error.text);
67+
flux_log (ctx->h,
68+
LOG_ERR,
69+
"error decoding exclude set %s: %s",
70+
exclude_idset,
71+
error.text);
7172
goto error;
7273
}
7374
if (idset_count (exclude->idset) > 0

t/t2315-resource-system.t

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ test_expect_success 'invalid exclude hosts cause instance failure' '
107107
test_must_fail flux start -s 2 \
108108
-o,--config-path=$(pwd)/${name},-Slog-filename=${name}/logfile \
109109
flux resource list -s up -no {nnodes} > ${name}/nnodes &&
110-
grep "nosuchhost: Invalid argument" ${name}/logfile
110+
grep "invalid hosts: nosuchhost" ${name}/logfile
111111
'
112112

113113
test_expect_success 'gpu resources in configured R are not verified' '

0 commit comments

Comments
 (0)