File pacemaker-crm_resource-no-command.patch of Package pacemaker.14737
commit e02d126d9a61e6657c3dcf0fed48f8f4dd57860d
Author: Ken Gaillot <kgaillot@redhat.com>
Date: Mon Oct 2 15:56:14 2017 -0500
Low: tools: ensure crm_resource works if no command is specified
diff --git a/tools/crm_resource.c b/tools/crm_resource.c
index ba341bf66..c37a5e830 100644
--- a/tools/crm_resource.c
+++ b/tools/crm_resource.c
@@ -277,8 +277,6 @@ main(int argc, char **argv)
bool recursive = FALSE;
char *our_pid = NULL;
- /* Not all commands set these appropriately, but the defaults here are
- * sufficient to get the logic right. */
bool require_resource = TRUE; /* whether command requires that resource be specified */
bool require_dataset = TRUE; /* whether command requires populated dataset instance */
bool require_crmd = FALSE; /* whether command requires connection to CRMd */
@@ -548,6 +546,11 @@ main(int argc, char **argv)
}
}
+ // Catch the case where the user didn't specify a command
+ if (rsc_cmd == 'L') {
+ require_resource = FALSE;
+ }
+
if (optind < argc
&& argv[optind] != NULL
&& rsc_cmd == 0