diff --git a/lib/train/transports/winrm_connection.rb b/lib/train/transports/winrm_connection.rb index 11d13a12..1d83d1de 100644 --- a/lib/train/transports/winrm_connection.rb +++ b/lib/train/transports/winrm_connection.rb @@ -27,7 +27,7 @@ class Train::Transports::WinRM # host such as executing commands, transferring files, etc. # # @author Fletcher Nichol - class Connection < BaseConnection + class Connection < BaseConnection # rubocop:disable Metrics/ClassLength attr_reader :hostname def initialize(options) super(options) @@ -183,7 +183,9 @@ def session(retry_options = {}) # # @api private def to_s - "<#{options.inspect}>" + options_to_print = @options.clone + options_to_print[:password] = '' if options_to_print.key?(:password) + "#{@username}@#{@hostname}<#{options_to_print.inspect}>" end class OS < OSCommon