Skip to content

Commit 8204bcd

Browse files
committed
Fix the handling of run_unless_sql_command in puppet 4
`Puppet::Util::SUIDManager.run_and_capture` (in puppet < 3.4) returns an array of the output and the `Process::Status` object. `Puppet::Util::Execution.execute` (in puppet >= 3.4) returns the output and saves the `Process::Status` object to `$CHILD_STATUS` This is handled in the provider, but the type was also trying to handle it, and was not last updated when the provider was.
1 parent 7870b38 commit 8204bcd

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

lib/puppet/type/postgresql_psql.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,7 @@ def sync
3434

3535
# Return true if a matching row is found
3636
def matches(value)
37-
if Puppet::PUPPETVERSION.to_f < 4
38-
output, status = provider.run_unless_sql_command(value)
39-
else
40-
output = provider.run_unless_sql_command(value)
41-
status = output.exitcode
42-
end
37+
output, status = provider.run_unless_sql_command(value)
4338
self.fail("Error evaluating 'unless' clause, returned #{status}: '#{output}'") unless status == 0
4439

4540
result_count = output.strip.to_i

0 commit comments

Comments
 (0)