Skip to content

Commit

Permalink
Dial it back a bit
Browse files Browse the repository at this point in the history
Signed-off-by: Clinton Wolfe <clintoncwolfe@gmail.com>
  • Loading branch information
clintoncwolfe committed Jan 8, 2019
1 parent a689d60 commit ae7b78b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
8 changes: 5 additions & 3 deletions lib/train.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,9 @@ def self.load_transport(transport_name)
end

# Legacy code to unpack a series of items from an incoming Hash
# Inspec::Config.unpack_train_credentials now handles this in most cases
def self.target_config(config) # TODO: deprecate
# Inspec::Config.unpack_train_credentials now handles this in most cases that InSpec needs
# If you need to unpack a URI, use upack_target_from_uri
def self.target_config(config = nil)
conf = config.dup
# Symbolize keys
conf.keys.each do |key|
Expand Down Expand Up @@ -100,7 +101,8 @@ def self.unpack_target_from_uri(uri_string, opts = {}) # rubocop: disable Metric
# ensure path is nil, if its empty; e.g. required to reset defaults for winrm # TODO: move logic into winrm plugin
creds[:path] = nil if !creds[:path].nil? && creds[:path].to_s.empty?

creds.compact!
# compat! is available in ruby 2.4+
creds = creds.delete_if { |_, value| value.nil? }

# return the updated config
creds
Expand Down
6 changes: 0 additions & 6 deletions lib/train/plugins/transport.rb
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,6 @@ def self.name(name)
Train::Plugins.registry[name] = self
end

# Describe the defaults for the options this transport provides.
def self.credential_option_defaults
# TODO
{}
end

private

# @return [Logger] logger for reporting information
Expand Down

0 comments on commit ae7b78b

Please sign in to comment.