Skip to content

Commit 8e3d81b

Browse files
committed
Refactor: libcib: Deduplicate tracing in cib_perform_op()
Signed-off-by: Reid Wahl <nrwahl@protonmail.com>
1 parent d897ae6 commit 8e3d81b

1 file changed

Lines changed: 4 additions & 8 deletions

File tree

lib/cib/cib_utils.c

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -502,6 +502,10 @@ cib_perform_op(enum cib_variant variant, cib__op_fn_t fn, xmlNode *req,
502502
input = get_op_input(req);
503503
enable_acl = cib_acl_enabled(*current_cib, user);
504504

505+
pcmk__trace("Processing %s for section '%s', user '%s'", op,
506+
pcmk__s(section, "(null)"), pcmk__s(user, "(null)"));
507+
pcmk__log_xml_trace(req, "request");
508+
505509
if (!should_copy_cib(op, section, call_options)) {
506510
// Make a copy of the top-level element to store version details
507511
top = pcmk__xe_create(NULL, (const char *) (*current_cib)->name);
@@ -514,10 +518,6 @@ cib_perform_op(enum cib_variant variant, cib__op_fn_t fn, xmlNode *req,
514518
pcmk__enable_acl(*current_cib, *current_cib, user);
515519
}
516520

517-
pcmk__trace("Processing %s for section '%s', user '%s'", op,
518-
pcmk__s(section, "(null)"), pcmk__s(user, "(null)"));
519-
pcmk__log_xml_trace(req, "request");
520-
521521
rc = fn(op, call_options, section, req, input, current_cib, output);
522522

523523
/* Set working_cib to *current_cib after fn(), in case *current_cib
@@ -535,10 +535,6 @@ cib_perform_op(enum cib_variant variant, cib__op_fn_t fn, xmlNode *req,
535535
pcmk__enable_acl(*current_cib, working_cib, user);
536536
}
537537

538-
pcmk__trace("Processing %s for section '%s', user '%s'", op,
539-
pcmk__s(section, "(null)"), pcmk__s(user, "(null)"));
540-
pcmk__log_xml_trace(req, "request");
541-
542538
rc = fn(op, call_options, section, req, input, &working_cib, output);
543539
}
544540

0 commit comments

Comments
 (0)