Skip to content

Commit 11b9809

Browse files
committed
no ssh key error
1 parent c375967 commit 11b9809

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

hub/include/HubController.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ typedef enum ssh_desktop_launch_error {
2020
SDLE_CONT_NOT_READY,
2121
SDLE_JOIN_TO_SWARM_FAILED,
2222
SDLE_SYSTEM_CALL_FAILED,
23+
SDLE_NO_KEY_DEPLOYED,
2324
SDLE_LAST_ERR
2425
} ssh_desktop_launch_error_t;
2526

hub/src/HubController.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -355,6 +355,9 @@ ssh_desktop_launch_error_t CHubController::ssh_to_container_internal(const CEnvi
355355
if (container_status != SDLE_SUCCESS) {
356356
return container_status;
357357
}
358+
if(key.isEmpty()){
359+
return SDLE_NO_KEY_DEPLOYED;
360+
}
358361
system_call_wrapper_error_t run_in_terminal_status = ssh_to_container_in_terminal(cont, key);
359362
if (run_in_terminal_status != SCWE_SUCCESS) {
360363
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) {
480483
"Container not found",
481484
"Container isn't ready",
482485
"Join to p2p swarm failed",
483-
"System call failed"};
484-
return lst_err_str[err % SDLE_LAST_ERR];
486+
"System call failed",
487+
"No key deployed"};
488+
return lst_err_str[err % SDLE_LAST_ERR];
485489
}
486490

487491
const QString CHubController::get_env_key(const QString &env_id) {

0 commit comments

Comments
 (0)