Skip to content

Commit 973c46e

Browse files
committed
Fix error messages in tasks
Because of misplaced `"` no interpolation of the error message was actually taking place. Rubocop had been warning about this bug, but was deactivated in both tasks (in different ways and by two different people)
1 parent 135f1c6 commit 973c46e

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

tasks/export.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ def get(file, database, user, password)
99
cmd_string << " --user=#{user}" unless user.nil?
1010
cmd_string << " --password=#{password}" unless password.nil?
1111
cmd_string << " > #{file}" unless file.nil?
12-
stdout, _stderr, status = Open3.capture3(cmd_string)
13-
raise Puppet::Error, _("stderr: ' %{stderr}') % { stderr: stderr }") if status != 0
12+
stdout, stderr, status = Open3.capture3(cmd_string)
13+
raise Puppet::Error, _("stderr: '%{stderr}'" % { stderr: stderr }) if status != 0
1414
{ status: stdout.strip }
1515
end
1616

tasks/sql.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ def get(sql, database, user, password)
88
cmd << "--database=#{database}" unless database.nil?
99
cmd << "--user=#{user}" unless user.nil?
1010
cmd << "--password=#{password}" unless password.nil?
11-
stdout, stderr, status = Open3.capture3(*cmd) # rubocop:disable Lint/UselessAssignment
12-
raise Puppet::Error, _("stderr: ' %{stderr}') % { stderr: stderr }") if status != 0
11+
stdout, stderr, status = Open3.capture3(*cmd)
12+
raise Puppet::Error, _("stderr: '%{stderr}'" % { stderr: stderr }) if status != 0
1313
{ status: stdout.strip }
1414
end
1515

0 commit comments

Comments
 (0)