From 230e933019a10837ad6315bac4010a0f11750e54 Mon Sep 17 00:00:00 2001 From: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com> Date: Wed, 6 Nov 2024 17:02:48 -0500 Subject: [PATCH] chore: cleanup ssh profile validation logic Signed-off-by: Fernando Rijo Cedeno <37381190+zFernand0@users.noreply.github.com> --- .../zowe-explorer/src/commands/UnixCommandHandler.ts | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/packages/zowe-explorer/src/commands/UnixCommandHandler.ts b/packages/zowe-explorer/src/commands/UnixCommandHandler.ts index 38200100e..5eb82b542 100644 --- a/packages/zowe-explorer/src/commands/UnixCommandHandler.ts +++ b/packages/zowe-explorer/src/commands/UnixCommandHandler.ts @@ -152,14 +152,10 @@ export class UnixCommandHandler extends ZoweCommandProvider { const profileStatus = await this.profileInstance.profileValidationHelper( this.sshProfile, - (prof: imperative.IProfileLoaded, type: string): Promise => - new Promise((resolve, reject) => { - if (type !== "ssh" || prof.profile.host !== this.sshSession.ISshSession.hostname) resolve("unverified"); - zosuss.Shell.isConnectionValid(this.sshSession) - .then((isValid: boolean) => resolve(isValid ? "active" : "inactive")) - .catch((error: any) => reject(error)); - }) - // } + async (prof: imperative.IProfileLoaded, type: string): Promise => { + if (type !== "ssh" || prof.profile.host !== this.sshSession.ISshSession.hostname) return "unverified"; + return (await zosuss.Shell.isConnectionValid(this.sshSession)) ? "active" : "inactive"; + } ); if (!this.sshSession || profileStatus !== "active") {