Merge pull request #654 from bmjen/fix-onlyif-tests

(FM-2931) fixes logic problem with onlyif type param validation.
This commit is contained in:
Travis Fields 2015-06-29 10:25:59 -07:00
commit d0493a28b9

View file

@ -51,12 +51,9 @@ Puppet::Type.newtype(:postgresql_psql) do
# Return true if a matching row is found
def matches(value)
if Puppet::PUPPETVERSION.to_f < 4
output, status = provider.run_unless_sql_command(value)
else
output = provider.run_unless_sql_command(value)
status = output.exitcode
end
output, status = provider.run_unless_sql_command(value)
status = output.exitcode if status.nil?
self.fail("Error evaluating 'onlyif' clause, returned #{status}: '#{output}'") unless status == 0
result_count = output.strip.to_i