diff --git a/hub/include/HubController.h b/hub/include/HubController.h index 87f1a39a..8178fe5c 100644 --- a/hub/include/HubController.h +++ b/hub/include/HubController.h @@ -20,6 +20,7 @@ typedef enum ssh_desktop_launch_error { SDLE_CONT_NOT_READY, SDLE_JOIN_TO_SWARM_FAILED, SDLE_SYSTEM_CALL_FAILED, + SDLE_NO_KEY_DEPLOYED, SDLE_LAST_ERR } ssh_desktop_launch_error_t; diff --git a/hub/src/HubController.cpp b/hub/src/HubController.cpp index 027a9b1d..b9e0307c 100644 --- a/hub/src/HubController.cpp +++ b/hub/src/HubController.cpp @@ -355,6 +355,9 @@ ssh_desktop_launch_error_t CHubController::ssh_to_container_internal(const CEnvi if (container_status != SDLE_SUCCESS) { return container_status; } + if(key.isEmpty()){ + return SDLE_NO_KEY_DEPLOYED; + } system_call_wrapper_error_t run_in_terminal_status = ssh_to_container_in_terminal(cont, key); if (run_in_terminal_status != SCWE_SUCCESS) { QString err_msg = tr("Run SSH failed. Error code : %1") @@ -480,8 +483,9 @@ const QString &CHubController::ssh_desktop_launch_err_to_str(int err) { "Container not found", "Container isn't ready", "Join to p2p swarm failed", - "System call failed"}; - return lst_err_str[err % SDLE_LAST_ERR]; + "System call failed", + "No key deployed"}; + return lst_err_str[err % SDLE_LAST_ERR]; } const QString CHubController::get_env_key(const QString &env_id) {