summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMartin Schwenke <martin@meltin.net>2014-07-03 11:10:12 +1000
committerMartin Schwenke <martin@meltin.net>2014-07-03 11:10:12 +1000
commit1679eda2d77a1a6ec377f3534343089ac7442910 (patch)
treec21549048220b85625f6294d813b7827053c5270
parent3301c6b70875131b333cb82bfe9654b57f9ecef0 (diff)
downloadautocluster-1679eda2d77a1a6ec377f3534343089ac7442910.tar.gz
autocluster-1679eda2d77a1a6ec377f3534343089ac7442910.tar.xz
autocluster-1679eda2d77a1a6ec377f3534343089ac7442910.zip
When exiting due to unknown node type, list valid node types
Signed-off-by: Martin Schwenke <martin@meltin.net>
-rwxr-xr-xautocluster8
1 files changed, 6 insertions, 2 deletions
diff --git a/autocluster b/autocluster
index 147670e..f3f0552 100755
--- a/autocluster
+++ b/autocluster
@@ -408,8 +408,12 @@ expand_nodes ()
local count=$((${node_count[$node_type]:-0} + 1))
node_count[$node_type]=$count
local fmt
- fmt=$(call_func node_name_format "$node_type") || \
- die "Node type \"${node_type}\" not defined!!!"
+ fmt=$(call_func node_name_format "$node_type") || {
+ echo "ERROR: Node type \"${node_type}\" not defined!"
+ echo "Valid node types are:"
+ set | sed -n 's@^node_name_format_\(.*\) ().*@ \1@p'
+ exit 1
+ }
# printf behaves weirdly if given too many args for format, so
# "head" handles the case where there is no %d or similar for
# $count.