From a05dcd0254d86aac1dbf099489c8aad74d53438f Mon Sep 17 00:00:00 2001 From: Frederick Borges Date: Thu, 1 Jul 2021 18:56:16 +0200 Subject: [PATCH] B #5241: Bug fix ssh private key (#1347) (cherry picked from commit c5b4445709b65a6c6aa2e88c46701b22250e113b) --- src/sunstone/models/sunstone_guac.rb | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/sunstone/models/sunstone_guac.rb b/src/sunstone/models/sunstone_guac.rb index 7c7507fcb8..8f3f83f673 100644 --- a/src/sunstone/models/sunstone_guac.rb +++ b/src/sunstone/models/sunstone_guac.rb @@ -207,11 +207,8 @@ class SunstoneGuac < SunstoneRemoteConnections end private_key = user['TEMPLATE/SSH_PRIVATE_KEY'] - - if private_key.nil? - error_message = 'SSH_PRIVATE_KEY not present in the USER:'\ - "#{OpenNebula::User::SELF} TEMPLATE" - return { :error => error(400, error_message) } + if !private_key.nil? + hash['private-key'] = private_key end passphrase = user['TEMPLATE/SSH_PASSPHRASE'] @@ -219,7 +216,6 @@ class SunstoneGuac < SunstoneRemoteConnections hash['passphrase'] = passphrase end - hash['private-key'] = private_key end {