Fix extraction of stonith parameter from parameter string

Pacemaker::Resource.extract_hash() is written to extract things from a complete
CIB object definition. Therefore it rightfully expects whitespaces before the
data_type ("params" in this case). So we just add those here to make the string
parsable by extract_hash.

https://bugzilla.novell.com/show_bug.cgi?id=887244
This commit is contained in:
Ralf Haferkamp 2014-07-17 14:42:50 +02:00
parent 68836e12bf
commit 0b93f5ea16
1 changed files with 2 additions and 2 deletions

View File

@ -93,7 +93,7 @@ when "shared"
if params.respond_to?('to_hash')
primitive_params = params.to_hash
elsif params.is_a?(String)
primitive_params = ::Pacemaker::Resource.extract_hash("params #{params}", "params")
primitive_params = ::Pacemaker::Resource.extract_hash(" params #{params}", "params")
else
message = "Unknown format for shared fencing agent parameters: #{params.inspect}."
Chef::Log.fatal(message)
@ -134,7 +134,7 @@ when "per_node"
if params.respond_to?('to_hash')
primitive_params = params.to_hash
elsif params.is_a?(String)
primitive_params = ::Pacemaker::Resource.extract_hash("params #{params}", "params")
primitive_params = ::Pacemaker::Resource.extract_hash(" params #{params}", "params")
else
message = "Unknown format for per-node fencing agent parameters of #{node_name}: #{params.inspect}."
Chef::Log.fatal(message)