Skip to content

Commit

Permalink
Merge pull request #171 from crepetl/fixes
Browse files Browse the repository at this point in the history
winrm: hide password
  • Loading branch information
adamleff authored Mar 27, 2017
2 parents 4a1ba1e + b71c554 commit e10d65b
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/train/transports/winrm_connection.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ class Train::Transports::WinRM
# host such as executing commands, transferring files, etc.
#
# @author Fletcher Nichol <fnichol@nichol.ca>
class Connection < BaseConnection
class Connection < BaseConnection # rubocop:disable Metrics/ClassLength
attr_reader :hostname
def initialize(options)
super(options)
Expand Down Expand Up @@ -183,7 +183,9 @@ def session(retry_options = {})
#
# @api private
def to_s
"<#{options.inspect}>"
options_to_print = @options.clone
options_to_print[:password] = '<hidden>' if options_to_print.key?(:password)
"#{@username}@#{@hostname}<#{options_to_print.inspect}>"
end

class OS < OSCommon
Expand Down

0 comments on commit e10d65b

Please sign in to comment.