Skip to content

Commit

Permalink
chore: cleanup ssh profile validation logic
Browse files Browse the repository at this point in the history
Signed-off-by: Fernando Rijo Cedeno <[email protected]>
  • Loading branch information
zFernand0 committed Nov 6, 2024
1 parent a18f7f6 commit 230e933
Showing 1 changed file with 4 additions and 8 deletions.
12 changes: 4 additions & 8 deletions packages/zowe-explorer/src/commands/UnixCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,10 @@ export class UnixCommandHandler extends ZoweCommandProvider {

const profileStatus = await this.profileInstance.profileValidationHelper(
this.sshProfile,
(prof: imperative.IProfileLoaded, type: string): Promise<string> =>
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<string> => {

Check warning on line 155 in packages/zowe-explorer/src/commands/UnixCommandHandler.ts

View check run for this annotation

Codecov / codecov/patch

packages/zowe-explorer/src/commands/UnixCommandHandler.ts#L155

Added line #L155 was not covered by tests
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") {
Expand Down

0 comments on commit 230e933

Please sign in to comment.