Skip to content

Commit

Permalink
Pass logger to Cisco IOS transport (#381)
Browse files Browse the repository at this point in the history
Inherit the logger (and log level) from upstream rather than presuming
we'll make a new one.

Signed-off-by: Bryan McLellan <btm@loftninjas.org>
  • Loading branch information
btm authored and jquick committed Dec 10, 2018
1 parent d444a37 commit c93845e
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 0 additions & 2 deletions lib/train/transports/cisco_ios_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ class BadEnablePassword < Train::TransportError; end
def initialize(options)
super(options)

logger.level = Logger::INFO

# Extract options to avoid passing them in to `Net::SSH.start` later
@host = options.delete(:host)
@user = options.delete(:user)
Expand Down
1 change: 1 addition & 0 deletions lib/train/transports/ssh.rb
Original file line number Diff line number Diff line change
Expand Up @@ -218,6 +218,7 @@ def create_new_connection(options, &block)
# We will also support the sudo password field for the same purpose
# for the interim. # TODO
ios_options[:enable_password] = @options[:enable_password] || @options[:sudo_password]
ios_options[:logger] = @options[:logger]
ios_options.merge!(@connection_options)
conn = CiscoIOSConnection.new(ios_options)
end
Expand Down

0 comments on commit c93845e

Please sign in to comment.