summaryrefslogtreecommitdiffstats
path: root/daemons/schedulerd/pacemaker-schedulerd.c
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:39:29 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-06-03 13:39:29 +0000
commitb41961d74fe7ff2d4d4abaca92454e87c561e49f (patch)
treeb34e3826a7b649dafdbd05081140c990c96d736d /daemons/schedulerd/pacemaker-schedulerd.c
parentReleasing progress-linux version 2.1.7-1~progress7.99u1. (diff)
downloadpacemaker-b41961d74fe7ff2d4d4abaca92454e87c561e49f.tar.xz
pacemaker-b41961d74fe7ff2d4d4abaca92454e87c561e49f.zip
Merging upstream version 2.1.8~rc1.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'daemons/schedulerd/pacemaker-schedulerd.c')
-rw-r--r--daemons/schedulerd/pacemaker-schedulerd.c32
1 files changed, 25 insertions, 7 deletions
diff --git a/daemons/schedulerd/pacemaker-schedulerd.c b/daemons/schedulerd/pacemaker-schedulerd.c
index 3f2a3e8..d1b9362 100644
--- a/daemons/schedulerd/pacemaker-schedulerd.c
+++ b/daemons/schedulerd/pacemaker-schedulerd.c
@@ -1,5 +1,5 @@
/*
- * Copyright 2004-2023 the Pacemaker project contributors
+ * Copyright 2004-2024 the Pacemaker project contributors
*
* The version control history for this file may have further details.
*
@@ -31,8 +31,8 @@ struct {
} options;
pcmk__output_t *logger_out = NULL;
-pcmk__output_t *out = NULL;
+static pcmk__output_t *out = NULL;
static GMainLoop *mainloop = NULL;
static qb_ipcs_service_t *ipcs = NULL;
static crm_exit_t exit_code = CRM_EX_OK;
@@ -46,6 +46,19 @@ pcmk__supported_format_t formats[] = {
void pengine_shutdown(int nsig);
+/* @COMPAT Deprecated since 2.1.8. Use pcmk_list_cluster_options() or
+ * crm_attribute --list-options=cluster instead of querying daemon metadata.
+ */
+static int
+scheduler_metadata(pcmk__output_t *out)
+{
+ return pcmk__daemon_metadata(out, "pacemaker-schedulerd",
+ "Pacemaker scheduler options",
+ "Cluster options used by Pacemaker's "
+ "scheduler",
+ pcmk__opt_schedulerd);
+}
+
static GOptionContext *
build_arg_context(pcmk__common_args_t *args, GOptionGroup **group) {
GOptionContext *context = NULL;
@@ -58,8 +71,7 @@ build_arg_context(pcmk__common_args_t *args, GOptionGroup **group) {
{ NULL }
};
- context = pcmk__build_arg_context(args, "text (default), xml", group,
- "[metadata]");
+ context = pcmk__build_arg_context(args, "text (default), xml", group, NULL);
pcmk__add_main_args(context, extra_prog_entries);
return context;
}
@@ -98,14 +110,20 @@ main(int argc, char **argv)
if (options.remainder) {
if (g_strv_length(options.remainder) == 1 &&
pcmk__str_eq("metadata", options.remainder[0], pcmk__str_casei)) {
- pe_metadata(out);
- goto done;
+
+ rc = scheduler_metadata(out);
+ if (rc != pcmk_rc_ok) {
+ exit_code = CRM_EX_FATAL;
+ g_set_error(&error, PCMK__EXITC_ERROR, exit_code,
+ "Unable to display metadata: %s", pcmk_rc_str(rc));
+ }
+
} else {
exit_code = CRM_EX_USAGE;
g_set_error(&error, PCMK__EXITC_ERROR, exit_code,
"Unsupported extra command line parameters");
- goto done;
}
+ goto done;
}
if (args->version) {