Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix ZWE messages #4200

Open
wants to merge 15 commits into
base: v3.x/staging
Choose a base branch
from
2 changes: 1 addition & 1 deletion bin/commands/init/stc/.errors
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ZWEL0157E|157|%s (%s) is not defined in Zowe YAML configuration file.
ZWEL0300W||%s already exists. This data set member will be overwritten during configuration.
ZWEL0301W||%s already exists and will not be overwritten. For upgrades, you must use --allow-overwrite.
ZWEL0143E|143|Cannot find data set member %s. You may need to re-run `zwe install`.
ZWEL0143E|143|%s.%s(%s) already exists. This data set member will be overwritten during configuration.
ZWEL0158E|158|%s already exists.
ZWEL0159E|159|Failed to modify %s.
ZWEL0160E|160|Failed to write to %s. Please check if target data set is opened by others.
1 change: 1 addition & 0 deletions bin/commands/start/.errors
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
ZWEL0064E|64|failed to run command os.pipe - Cannot start component %
ZWEL0165E|165|Failed to start job %s: %s.
1 change: 1 addition & 0 deletions bin/commands/support/verify-fingerprints/.errors
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ ZWEL0122E|122|Cannot find java. Please define JAVA_HOME environment variable.
ZWEL0150E|150|Failed to find file %s. Zowe runtimeDirectory is invalid.
ZWEL0151E|151|Failed to create temporary file %s. Please check permission or volume free space.
ZWEL0181E|181|Failed to verify Zowe file fingerprints.
ZWEL0319E|319|Failed to compare hashes of %s and current.
14 changes: 9 additions & 5 deletions bin/commands/support/verify-fingerprints/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,8 @@ export function execute(doNotExit: Boolean, javaHome: string): void {
if (fs.fileExists(manifest)) {
manifestContent = xplatform.loadFileUTF8(manifest, xplatform.AUTO_DETECT);
} else {
common.printErrorAndExit(`Error ZWEL0150E: Failed to find file "${manifest}". Zowe runtimeDirectory is invalid.`, undefined, 150);
const missingFile = manifest;
common.printErrorAndExit(`Error ZWEL0150E: Failed to find file ${missingFile}. Zowe runtimeDirectory is invalid.`, undefined, 150);
}
if (manifestContent) {
manifestJson = JSON.parse(manifestContent);
Expand All @@ -68,18 +69,20 @@ export function execute(doNotExit: Boolean, javaHome: string): void {
const zoweVersion = manifestJson.version;

if (!fs.fileExists(`${zoweRuntime}/bin/utils/HashFiles.class`)) {
common.printErrorAndExit(`Error ZWEL0150E: Failed to find file "${zoweRuntime}/bin/utils/HashFiles.class". Zowe runtimeDirectory is invalid.`, undefined, 150);
const missingFile = `${zoweRuntime}/bin/utils/HashFiles.class`;
common.printErrorAndExit(`Error ZWEL0150E: Failed to find file ${missingFile}. Zowe runtimeDirectory is invalid.`, undefined, 150);
}

if (!fs.fileExists(`${zoweRuntime}/fingerprint/RefRuntimeHash-${zoweVersion}.txt`)) {
common.printErrorAndExit(`Error ZWEL0150E: Failed to find file "${zoweRuntime}/fingerprint/RefRuntimeHash-${zoweVersion}.txt". Zowe runtimeDirectory is invalid.`, undefined, 150);
const missingFile = `${zoweRuntime}/fingerprint/RefRuntimeHash-${zoweVersion}.txt`;
common.printErrorAndExit(`Error ZWEL0150E: Failed to find file ${missingFile}. Zowe runtimeDirectory is invalid.`, undefined, 150);
}

common.printMessage('- Create Zowe directory file list');
const allFiles = fs.createTmpFile(tmpFilePrefix);
shell.execOutSync('sh', '-c', `cd '${zoweRuntime}' && find . -name ./SMPE -prune -o -name "./ZWE*" -prune -o -name ./fingerprint -prune -o -type f -print > "${allFiles}"`);
if (!fs.fileExists(allFiles)) {
common.printErrorAndExit(`Error ZWEL0151E: Failed to create temporary file "${allFiles}". Please check permission or volume free space.`, undefined, 151);
common.printErrorAndExit(`Error ZWEL0151E: Failed to create temporary file ${allFiles}. Please check permission or volume free space.`, undefined, 151);
}

common.printDebug(` * File list created as ${allFiles}`);
Expand Down Expand Up @@ -122,7 +125,8 @@ export function execute(doNotExit: Boolean, javaHome: string): void {
common.printMessage(`- Find ${commStepName} files`);
const commResult = shell.execOutSync('sh', '-c', `cd '${zoweRuntime}' && comm -${commParameter} "${zoweRuntime}/fingerprint/RefRuntimeHash-${zoweVersion}.txt" "${customHashes}"`);
if (commResult.rc) {
common.printError(` * Error ZWEL0151E: Failed to compare hashes of fingerprint/RefRuntimeHash-${zoweVersion}.txt and current.`);
const hashFile = `fingerprint/RefRuntimeHash-${zoweVersion}.txt`;
common.printError(` * Error ZWEL0319E: Failed to compare hashes of ${hashFile} and current.`);
common.printError(` * Exit code: ${commResult.rc}`);
if (commResult.out) {
common.printError(` * Output:`);
Expand Down
Loading