Fixes based on PR feedback.

Signed-off-by: Miah Johnson <miah@chia-pet.org>
This commit is contained in:
Miah Johnson 2019-10-31 11:44:08 -07:00
parent c582895434
commit b63e886523

View file

@ -1,5 +1,4 @@
require "inspec/resources/command" require "inspec/resources/command"
require "hashie/mash"
require "inspec/utils/database_helpers" require "inspec/utils/database_helpers"
require "htmlentities" require "htmlentities"
require "rexml/document" require "rexml/document"
@ -21,8 +20,8 @@ module Inspec::Resources
end end
EXAMPLE EXAMPLE
attr_reader :user, :password, :host, :port, :service, attr_reader :bin, :db_role, :host, :password, :port, :service,
:db_role, :su_user, :bin :su_user, :user
def initialize(opts = {}) def initialize(opts = {})
@user = opts[:user] @user = opts[:user]
@ -74,7 +73,7 @@ module Inspec::Resources
# su, using a db_role # su, using a db_role
def command_builder(format_options, query) def command_builder(format_options, query)
verified_query = verify_query(query) verified_query = verify_query(query)
sql_prefix, sql_postfix = "" sql_prefix, sql_postfix = "", ""
if inspec.os.windows? if inspec.os.windows?
sql_prefix = %{@'\n#{format_options}\n#{verified_query}\nEXIT\n'@ | } sql_prefix = %{@'\n#{format_options}\n#{verified_query}\nEXIT\n'@ | }
else else