Merge pull request #654 from bmjen/fix-onlyif-tests
(FM-2931) fixes logic problem with onlyif type param validation.
This commit is contained in:
commit
d0493a28b9
1 changed files with 3 additions and 6 deletions
|
@ -51,12 +51,9 @@ Puppet::Type.newtype(:postgresql_psql) do
|
||||||
|
|
||||||
# Return true if a matching row is found
|
# Return true if a matching row is found
|
||||||
def matches(value)
|
def matches(value)
|
||||||
if Puppet::PUPPETVERSION.to_f < 4
|
|
||||||
output, status = provider.run_unless_sql_command(value)
|
output, status = provider.run_unless_sql_command(value)
|
||||||
else
|
status = output.exitcode if status.nil?
|
||||||
output = provider.run_unless_sql_command(value)
|
|
||||||
status = output.exitcode
|
|
||||||
end
|
|
||||||
self.fail("Error evaluating 'onlyif' clause, returned #{status}: '#{output}'") unless status == 0
|
self.fail("Error evaluating 'onlyif' clause, returned #{status}: '#{output}'") unless status == 0
|
||||||
|
|
||||||
result_count = output.strip.to_i
|
result_count = output.strip.to_i
|
||||||
|
|
Loading…
Reference in a new issue