Skip to content

Commit

Permalink
Registered ssh profile types
Browse files Browse the repository at this point in the history
Signed-off-by: Likhitha Nimma <Likhitha.Nimma@ibm.com>
  • Loading branch information
likhithanimma1 committed Nov 17, 2023
1 parent 05f3f44 commit 00d3cc1
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ describe("ProfilesCache", () => {
expect(profCache.allProfiles.length).toEqual(2);
expect(profCache.allProfiles[0]).toMatchObject(lpar1Profile);
expect(profCache.allProfiles[1]).toMatchObject(zftpProfile);
expect(profCache.getAllTypes()).toEqual([...profileTypes, "base"]);
expect(profCache.getAllTypes()).toEqual([...profileTypes, "ssh","base"]);
expect(mockLogError).not.toHaveBeenCalled();
});

Expand All @@ -281,7 +281,7 @@ describe("ProfilesCache", () => {
expect(profCache.allProfiles[0]).toMatchObject(lpar1ProfileWithToken);
expect(profCache.allProfiles[1]).toMatchObject(lpar2Profile); // without token
expect(profCache.allProfiles[2]).toMatchObject(baseProfileWithToken);
expect(profCache.getAllTypes()).toEqual([...profileTypes, "base"]);
expect(profCache.getAllTypes()).toEqual([...profileTypes, "ssh","base"]);
expect(mockLogError).not.toHaveBeenCalled();
});

Expand Down
2 changes: 1 addition & 1 deletion packages/zowe-explorer-api/src/profiles/ProfilesCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export class ProfilesCache {
return;
}
const allTypes = this.getAllProfileTypes(apiRegister.registeredApiTypes());
allTypes.push("base");
allTypes.push("ssh","base");
for (const type of allTypes) {
const tmpAllProfiles: zowe.imperative.IProfileLoaded[] = [];
// Step 1: Get all profiles for each registered type
Expand Down
2 changes: 1 addition & 1 deletion packages/zowe-explorer/src/command/UnixCommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ export class UnixCommandHandler extends ZoweCommandProvider {
}
if (ZoweExplorerApiRegister.getCommandApi(profile).sshProfileRequired) {
this.sshSession = await this.setsshSession();
if(!this.sshSession) return;
} else {
Gui.showMessage(localize("issueUnixCommand.apiNonExisting", "Not implemented yet for profile of type: ") + profile.type);
return;
Expand Down Expand Up @@ -153,7 +154,6 @@ export class UnixCommandHandler extends ZoweCommandProvider {
}
}
}

public async setsshSession(): Promise<SshSession> {
ZoweLogger.trace("UnixCommandHandler.setsshSession called.");
const sshprofile: imperative.IProfileLoaded = Profiles.getInstance().getDefaultProfile("ssh");
Expand Down

0 comments on commit 00d3cc1

Please sign in to comment.