For per_node STONITH, be a bit clever for auto-generation of host* param

Some STONITH plugin take hostname as param, while some take hostlist.
And we can't really guess that. So for now, we check if there's a
hostname or hostlist key in the params, and if one of them is there, we
don't do anything. If none is them, we try with hostname.
This commit is contained in:
Vincent Untz 2014-03-27 10:21:20 +01:00
parent 7722560153
commit 3016e33d0f
1 changed files with 5 additions and 5 deletions

View File

@ -93,11 +93,11 @@ when "per_node"
raise message
end
# Only set hostlist param if it's missing; we do not overwrite it as the
# user might have passed more information than just the hostname (some
# plugins accept hostname:data in hostlist)
unless primitive_params.has_key?("hostlist")
primitive_params["hostlist"] = node_name
# Only set one of hostname / hostlist param if none of them are present; we
# do not overwrite it as the user might have passed more information than
# just the hostname (some plugins accept hostname:data in hostlist)
unless primitive_params.has_key?("hostname") || primitive_params.has_key?("hostlist")
primitive_params["hostname"] = node_name
end
pacemaker_primitive stonith_resource do