Skip to content

Commit 90290f6

Browse files
committed
(FM-2931) fixes logic problem with onlyif type param validation.
1 parent 855718e commit 90290f6

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

lib/puppet/type/postgresql_psql.rb

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,9 @@ def matches(value)
5151

5252
# Return true if a matching row is found
5353
def matches(value)
54-
if Puppet::PUPPETVERSION.to_f < 4
55-
output, status = provider.run_unless_sql_command(value)
56-
else
57-
output = provider.run_unless_sql_command(value)
58-
status = output.exitcode
59-
end
54+
output, status = provider.run_unless_sql_command(value)
55+
status = output.exitcode if status.nil?
56+
6057
self.fail("Error evaluating 'onlyif' clause, returned #{status}: '#{output}'") unless status == 0
6158

6259
result_count = output.strip.to_i

0 commit comments

Comments
 (0)