From 3016e33d0f8cdd88ba5632464f6469a8164cbace Mon Sep 17 00:00:00 2001 From: Vincent Untz Date: Thu, 27 Mar 2014 10:21:20 +0100 Subject: [PATCH] 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. --- recipes/stonith.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/recipes/stonith.rb b/recipes/stonith.rb index af3c6f5..84bdcd6 100644 --- a/recipes/stonith.rb +++ b/recipes/stonith.rb @@ -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