diff --git a/lib/train/platforms/detect/helpers/os_common.rb b/lib/train/platforms/detect/helpers/os_common.rb index f2126054..7fb070e6 100644 --- a/lib/train/platforms/detect/helpers/os_common.rb +++ b/lib/train/platforms/detect/helpers/os_common.rb @@ -34,7 +34,7 @@ def command_output(cmd) # When you try to execute command using ssh connction as root user and you have provided ssh user identity file # it gives standard output to login as authorised user other than root. To show this standard ouput as an error # to user we are matching the string of stdout and raising the error here so that user gets exact information. - if @backend.class == Train::Transports::SSH::Connection && res =~ /Please login as the user/ + if @backend.class.to_s == "Train::Transports::SSH::Connection" && res =~ /Please login as the user/ raise Train::UserError, "SSHFailed: #{res}" end res.strip! unless res.nil?