Skip to content

Commit 55f6ffe

Browse files
Merge pull request #159 from pcoop/branch1
Rename parms to follow the naming convention
2 parents 0e5941e + d39d1b6 commit 55f6ffe

20 files changed

+180
-178
lines changed

__tests__/api/BundlePush/BundlePusher.test.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ describe("BundlePusher01", () => {
415415

416416
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", true,
417417
"A problem occurred attempting to run 'if [ \"$(ls)\" ]; then rm -r *; fi' in remote directory '/u/ThisDoesNotExist/12345678'. " +
418-
"Problem is: The output from the remote command implied that an error occurred.");
418+
"Problem is: The output from the remote command implied that an error occurred, return code 1.");
419419

420420
expect(consoleText).toContain("Ssh command exit with non zero status");
421421
expect(zosMFSpy).toHaveBeenCalledTimes(1);
@@ -434,7 +434,7 @@ describe("BundlePusher01", () => {
434434

435435
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", true,
436436
"A problem occurred attempting to run 'if [ \"$(ls)\" ]; then rm -r *; fi' in remote directory '/u/ThisDoesNotExist/12345678'. " +
437-
"Problem is: The output from the remote command implied that an error occurred.");
437+
"Problem is: The output from the remote command implied that an error occurred, return code 127");
438438

439439
expect(consoleText).toContain("Injected FSUM9195 error message");
440440
expect(zosMFSpy).toHaveBeenCalledTimes(1);
@@ -453,7 +453,7 @@ describe("BundlePusher01", () => {
453453

454454
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", true,
455455
"A problem occurred attempting to run 'if [ \"$(ls)\" ]; then rm -r *; fi' in remote directory '/u/ThisDoesNotExist/12345678'. " +
456-
"Problem is: The output from the remote command implied that an error occurred.");
456+
"Problem is: The output from the remote command implied that an error occurred, return code 1.");
457457

458458
expect(consoleText).toContain("Injected FSUM9195 and FSUM9196 error message");
459459
expect(zosMFSpy).toHaveBeenCalledTimes(1);
@@ -647,7 +647,7 @@ describe("BundlePusher01", () => {
647647
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", false,
648648
"A problem occurred attempting to run 'export PATH=\"$PATH:/usr/lpp/IBM/cnj/IBM/node-latest-os390-s390x/bin\" " +
649649
"&& npm install' in remote directory '/u/ThisDoesNotExist/12345678'. " +
650-
"Problem is: The output from the remote command implied that an error occurred.");
650+
"Problem is: The output from the remote command implied that an error occurred, return code 1.");
651651

652652
expect(consoleText).toContain("Injected stdout error message");
653653
expect(zosMFSpy).toHaveBeenCalledTimes(1);
@@ -680,7 +680,7 @@ describe("BundlePusher01", () => {
680680
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", false,
681681
"A problem occurred attempting to run 'export PATH=\"$PATH:/usr/lpp/IBM/cnj/IBM/node-latest-os390-s390x/bin\" " +
682682
"&& npm install' in remote directory '/u/ThisDoesNotExist/12345678'. " +
683-
"Problem is: The output from the remote command implied that an error occurred.");
683+
"Problem is: The output from the remote command implied that an error occurred, return code 1.");
684684

685685
expect(consoleText).toContain("Injected FSUM7351 not found message");
686686
expect(zosMFSpy).toHaveBeenCalledTimes(1);
@@ -713,7 +713,7 @@ describe("BundlePusher01", () => {
713713
await runPushTestWithError("__tests__/__resources__/ExampleBundle01", false,
714714
"A problem occurred attempting to run 'export PATH=\"$PATH:/usr/lpp/IBM/cnj/IBM/node-latest-os390-s390x/bin\" " +
715715
"&& npm install' in remote directory '/u/ThisDoesNotExist/12345678'. " +
716-
"Problem is: The output from the remote command implied that an error occurred.");
716+
"Problem is: The output from the remote command implied that an error occurred, return code 1.");
717717

718718
expect(consoleText).toContain("Injected npm ERR! Exit status 1 message");
719719
expect(zosMFSpy).toHaveBeenCalledTimes(1);

docs-internal/CLIReadme.md

Lines changed: 104 additions & 102 deletions
Large diffs are not rendered by default.

src/api/BundlePush/BundlePusher.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -372,7 +372,7 @@ export class BundlePusher {
372372
}
373373

374374
this.sshOutputText = "";
375-
const shell = await Shell.executeSshCwd(sshSession, sshCommand, directory, this.sshOutput.bind(this));
375+
const sshReturnCode = await Shell.executeSshCwd(sshSession, sshCommand, directory, this.sshOutput.bind(this));
376376
const upperCaseOutputText = this.sshOutputText.toUpperCase();
377377

378378
// Note that FSUM9195 can imply that we've tried to delete the
@@ -383,19 +383,19 @@ export class BundlePusher {
383383
const countFSUM9195 = (upperCaseOutputText.match(/FSUM9195/g) || []).length;
384384
if (countFSUM9195 !== 0 &&
385385
countFSUM === countFSUM9195 &&
386-
shell === 1) {
386+
sshReturnCode === 1) {
387387
isOnlyFSUM9195 = true;
388388
}
389389

390390
// Now check
391391
// A. If exit code is non zero
392392
// B. FSUM9195 is not the only FSUM error
393-
if (shell !== 0 && !isOnlyFSUM9195) {
393+
if (sshReturnCode !== 0 && !isOnlyFSUM9195) {
394394
// if we've not already logged the output, log it now
395395
if (this.params.arguments.verbose !== true) {
396396
this.params.response.console.log(Buffer.from(this.sshOutputText));
397397
}
398-
throw new Error("The output from the remote command implied that an error occurred.");
398+
throw new Error("The output from the remote command implied that an error occurred, return code " + sshReturnCode + ".");
399399
}
400400
}
401401
catch (error) {

src/cli/deploy/bundle/DeployBundle.definition.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,16 @@ export const DeployBundleDefinition: ICommandDefinition = {
4444
examples: [
4545
{
4646
description: "Deploy a CICS bundle with a specific name and location to a default set of target regions",
47-
options: `--name EXAMPLE --bundledir /u/example/bundleDir`
47+
options: `--name EXAMPLE --bundle-directory /u/example/bundleDir`
4848
},
4949
{
5050
description: "Deploy a CICS bundle, but declare a timeout if the processing takes too long",
51-
options: `--name EXAMPLE --bundledir /u/example/bundleDir --timeout 60`
51+
options: `--name EXAMPLE --bundle-directory /u/example/bundleDir --timeout 60`
5252
},
5353
{
5454
description: "Deploy a CICS bundle to a specific target environment by using specific zosmf & cics-deploy profiles",
55-
options: `--name EXAMPLE --bundledir /u/example/bundleDir --cicsplex TESTPLEX --scope SCOPE --resgroup BUNDGRP ` +
56-
`--cicshlq CICSTS55.CICS720 --cpsmhlq CICSTS55.CPSM550 --zosmf-profile testplex --cics-deploy-profile devcics`
55+
options: `--name EXAMPLE --bundle-directory /u/example/bundleDir --cicsplex TESTPLEX --scope SCOPE --res-group BUNDGRP ` +
56+
`--cics-hlq CICSTS55.CICS720 --cpsm-hlq CICSTS55.CPSM550 --zosmf-profile testplex --cics-deploy-profile devcics`
5757
}
5858
]
5959
};

src/cli/deploy/bundle/options/Bundledir.option.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ const MAX_LENGTH = 255;
1818
*
1919
*/
2020
export const BundledirOption: ICommandOptionDefinition = {
21-
name: "bundledir",
22-
aliases: ["bd"],
21+
name: "bundle-directory",
22+
aliases: ["bd", "bundledir", "bundle-dir"],
2323
type: "string",
2424
required: true,
2525
stringLengthRange: [1, MAX_LENGTH],

src/cli/deploy/bundle/options/TargetState.option.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import { ICommandOptionDefinition } from "@zowe/imperative";
1616
*
1717
*/
1818
export const TargetStateOption: ICommandOptionDefinition = {
19-
name: "targetstate",
20-
aliases: ["ts"],
19+
name: "target-state",
20+
aliases: ["ts", "targetstate"],
2121
type: "string",
2222
required: false,
2323
defaultValue: "ENABLED",

src/cli/generate/bundle/GenerateBundle.definition.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ export const GenerateBundleDefinition: ICommandDefinition = {
2929
description: "Generate a CICS bundle in the working directory. " +
3030
"The associated data is constructed from a combination of the " +
3131
"command-line options and the contents of package.json. If package.json exists, " +
32-
"no options are required. If package.json does not exist, both --startscript and --nodejsapp are required.",
32+
"no options are required. If package.json does not exist, both --start-script and --nodejsapp are required.",
3333
type: "command",
3434
handler: __dirname + "/GenerateBundle.handler",
3535
options: [ BundleidOption, BundleversionOption, NodejsappOption, StartscriptOption, PortOption,
@@ -41,11 +41,11 @@ export const GenerateBundleDefinition: ICommandDefinition = {
4141
},
4242
{
4343
description: "Generate a CICS bundle in the working directory, based on package.json but using a bundle ID of \"mybundle\"",
44-
options: `--bundleid mybundle`
44+
options: `--bundle-id mybundle`
4545
},
4646
{
4747
description: "Generate a CICS bundle in the working directory in which a package.json does not exist",
48-
options: `--bundleid mybundle --nodejsapp myapp --startscript server.js`
48+
options: `--bundle-id mybundle --nodejsapp myapp --start-script server.js`
4949
}
5050
]
5151
};

src/cli/generate/bundle/options/Bundleid.option.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import { ICommandOptionDefinition } from "@zowe/imperative";
1616
*
1717
*/
1818
export const BundleidOption: ICommandOptionDefinition = {
19-
name: "bundleid",
20-
aliases: ["b", "id", "bid"],
19+
name: "bundle-id",
20+
aliases: ["b", "id", "bundleid"],
2121
type: "string",
2222
description: "The ID for the generated CICS bundle, up to 64 characters. If no value is " +
2323
"specified, a default value is created from the 'name' property " +

src/cli/generate/bundle/options/Bundleversion.option.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import { ICommandOptionDefinition } from "@zowe/imperative";
1616
*
1717
*/
1818
export const BundleversionOption: ICommandOptionDefinition = {
19-
name: "bundleversion",
20-
aliases: ["bv", "bundlever"],
19+
name: "bundle-version",
20+
aliases: ["bv", "bundleversion"],
2121
type: "string",
2222
description: "The major.minor.micro version number for the generated CICS bundle. If no value is " +
2323
"specified, a default value of 1.0.0 is used."

src/cli/generate/bundle/options/Startscript.option.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ import { ICommandOptionDefinition } from "@zowe/imperative";
1616
*
1717
*/
1818
export const StartscriptOption: ICommandOptionDefinition = {
19-
name: "startscript",
20-
aliases: ["s", "ss"],
19+
name: "start-script",
20+
aliases: ["s", "ss", "startscript"],
2121
type: "string",
2222
description: "Up to 255 character path to the Node.js start script that runs when " +
2323
"the associated bundle is enabled in CICS. If a value is not " +

0 commit comments

Comments
 (0)