Skip to content

Commit

Permalink
fix noisy logs when authPluginLib empty, schema allows empty authPlug…
Browse files Browse the repository at this point in the history
…inLib, regex multiline

Signed-off-by: MarkAckert <[email protected]>
  • Loading branch information
MarkAckert committed Feb 10, 2025
1 parent 3c0d6c2 commit 9addee4
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
10 changes: 7 additions & 3 deletions bin/commands/init/apfauth/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,11 @@ export function execute() {
}

let result1 = zosDs.isDatasetSmsManaged(ZOWE_CONFIG.zowe.setup.dataset.authLoadlib);
let result2 = zosDs.isDatasetSmsManaged(ZOWE_CONFIG.zowe.setup.dataset.authPluginLib);

let result2: {rc: number, smsManaged?: boolean | null } = {rc: 1, smsManaged: null}; // default used when shouldAuthPlugin=false
if (shouldAuthPluginLib) {
result2 = zosDs.isDatasetSmsManaged(ZOWE_CONFIG.zowe.setup.dataset.authPluginLib);
}

if (result1.rc != 0) {
common.printErrorAndExit(`Error ZWEL0320E: The dataset specified in 'zowe.setup.dataset.authLoadlib' does not exist.`, undefined, 320);
Expand Down Expand Up @@ -94,8 +98,8 @@ export function execute() {

if (!shouldAuthPluginLib) {
// replace 2 export lines (33 and 34 in IAPF2 at time of writing)
jclContent.out = jclContent.out.replace(/\nexport PLUGLIB=.*\nexport PLUGLOC=SMS.*$/g, '');
jclContent.out = jclContent.out.replace(/\n\.\/opercmd\.rex.*?PLUGLOC.*$/g, '');
jclContent.out = jclContent.out.replace(/\nexport PLUGLIB=.*\nexport PLUGLOC=SMS.*$/gm, '');
jclContent.out = jclContent.out.replace(/\n\.\/opercmd\.rex.*?PLUGLOC.*$/gm, '');
}

xplatform.storeFileUTF8(tmpfile, xplatform.AUTO_DETECT, jclContent.out);
Expand Down
12 changes: 10 additions & 2 deletions schemas/zowe-yaml-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,16 @@
"default": "<hlq>.SZWEAUTH"
},
"authPluginLib": {
"$ref": "/schemas/v2/server-common#zoweDataset",
"description": "APF authorized LOADLIB for Zowe ZIS Plugins"
"oneOf": [{
"$ref": "/schemas/v2/server-common#zoweDataset",
"description": "APF authorized LOADLIB for Zowe ZIS Plugins"
}, {
"type": "string",
"minLength": 0,
"maxLength": 0,
"required": "false"
}
]
}
}
},
Expand Down

0 comments on commit 9addee4

Please sign in to comment.