Skip to content

Commit

Permalink
Fix error messages in tasks
Browse files Browse the repository at this point in the history
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)
  • Loading branch information
alexjfisher committed Oct 15, 2019
1 parent 135f1c6 commit 6229afc
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions tasks/export.rb
Expand Up @@ -9,8 +9,8 @@ def get(file, database, user, password)
cmd_string << " --user=#{user}" unless user.nil?
cmd_string << " --password=#{password}" unless password.nil?
cmd_string << " > #{file}" unless file.nil?
stdout, _stderr, status = Open3.capture3(cmd_string)
raise Puppet::Error, _("stderr: ' %{stderr}') % { stderr: stderr }") if status != 0
stdout, stderr, status = Open3.capture3(cmd_string)
raise Puppet::Error, _("stderr: '%{stderr}'" % { stderr: stderr }) if status != 0
{ status: stdout.strip }
end

Expand Down
4 changes: 2 additions & 2 deletions tasks/sql.rb
Expand Up @@ -8,8 +8,8 @@ def get(sql, database, user, password)
cmd << "--database=#{database}" unless database.nil?
cmd << "--user=#{user}" unless user.nil?
cmd << "--password=#{password}" unless password.nil?
stdout, stderr, status = Open3.capture3(*cmd) # rubocop:disable Lint/UselessAssignment
raise Puppet::Error, _("stderr: ' %{stderr}') % { stderr: stderr }") if status != 0
stdout, stderr, status = Open3.capture3(*cmd)
raise Puppet::Error, _("stderr: '%{stderr}'" % { stderr: stderr }) if status != 0
{ status: stdout.strip }
end

Expand Down

0 comments on commit 6229afc

Please sign in to comment.