correctly parse empty parameter values in CIB objects
For a CIB object definition such as:
primitive database-config-default-fs ocf💓Filesystem \
params device="/dev/drbd/postgresql" directory="/var/lib/pgsql" fstype="" \
op monitor interval="10s"
when #extract_hash attempts to extract the 'params' section,
Shellwords.split will return an Array whose last element is
fstype=
not
fstype=""
as you might expect. Therefore we need to allow for an empty string to
the right of the equals sign, otherwise parsing fails.
This commit is contained in:
@@ -45,7 +45,7 @@ module Pacemaker
|
|||||||
h = {}
|
h = {}
|
||||||
Shellwords.split($1).each do |kvpair|
|
Shellwords.split($1).each do |kvpair|
|
||||||
break if kvpair == 'op'
|
break if kvpair == 'op'
|
||||||
unless kvpair =~ /^(.+?)=(.+)$/
|
unless kvpair =~ /^(.+?)=(.*)$/
|
||||||
raise "Couldn't understand '#{kvpair}' for '#{data_type}' section "\
|
raise "Couldn't understand '#{kvpair}' for '#{data_type}' section "\
|
||||||
"of #{name} primitive (definition was [#{obj_definition}])"
|
"of #{name} primitive (definition was [#{obj_definition}])"
|
||||||
end
|
end
|
||||||
|
Reference in New Issue
Block a user