File pacemaker-crm_standby-version-help-without-cluster.patch of Package pacemaker.14737
commit 993582b7b883e5592e73f6a2cdfc87669bc0bf03
Author: Ken Gaillot <kgaillot@redhat.com>
Date: Thu Oct 6 17:12:34 2016 -0500
Fix: tools: crm_standby --version/--help should work without cluster
fixes CLBZ#5298
diff --git a/tools/crm_standby b/tools/crm_standby
index c1b14b6..0b30eb6 100755
--- a/tools/crm_standby
+++ b/tools/crm_standby
@@ -24,7 +24,7 @@ Options:
op=""
options=""
lifetime=0
-target=$(crm_node -n)
+target=""
BACKWARD_COMPATIBLE="get-value,attr-value:,delete-attr,uname:,attr-id:"
TEMP=$(getopt -o qDGQVN:U:v:i:l: \
@@ -56,6 +56,12 @@ while true ; do
esac
done
+# It's important to call cluster commands only after arguments are processed,
+# so --version and --help work without problems even if those commands don't.
+if [ "$target" = "" ]; then
+ target=$(crm_node -n)
+fi
+
options="-N $target -n standby $options"
if [ x$op = x ]; then
options="$options -G"; op=g