Skip to content

Commit

Permalink
Support runing gener if zweimvs is not found, such as in pre-existing…
Browse files Browse the repository at this point in the history
… jcllib (like smpe case)

Signed-off-by: 1000TurquoisePogs <[email protected]>
  • Loading branch information
1000TurquoisePogs committed May 14, 2024
1 parent 319bacb commit bb10e99
Show file tree
Hide file tree
Showing 8 changed files with 35 additions and 71 deletions.
15 changes: 5 additions & 10 deletions bin/commands/init/apfauth/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,9 @@
# Copyright Contributors to the Zowe Project.
#######################################################################

USE_CONFIGMGR=$(check_configmgr_enabled)
if [ "${USE_CONFIGMGR}" = "true" ]; then
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then

# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/apfauth/cli.js"
else
print_error_and_exit "Error ZWEL0316E: Command requires zowe.useConfigmgr=true to use." "" 316
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then
# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/apfauth/cli.js"

14 changes: 5 additions & 9 deletions bin/commands/init/generate/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,9 @@
# Copyright Contributors to the Zowe Project.
#######################################################################

USE_CONFIGMGR=$(check_configmgr_enabled)
if [ "${USE_CONFIGMGR}" = "true" ]; then
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then
# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/generate/cli.js"
else
print_error_and_exit "Error ZWEL0316E: Command requires zowe.useConfigmgr=true to use." "" 316
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then
# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/generate/cli.js"

14 changes: 4 additions & 10 deletions bin/commands/init/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,8 @@

init_missing_yaml_properties

USE_CONFIGMGR=$(check_configmgr_enabled)
if [ "${USE_CONFIGMGR}" = "true" ]; then
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then

# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/cli.js"
else
print_error_and_exit "Error ZWEL0316E: Command requires zowe.useConfigmgr=true to use." "" 316
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then
# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/cli.js"
15 changes: 5 additions & 10 deletions bin/commands/init/mvs/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,9 @@

init_missing_yaml_properties

USE_CONFIGMGR=$(check_configmgr_enabled)
if [ "${USE_CONFIGMGR}" = "true" ]; then
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then

# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/mvs/cli.js"
else
print_error_and_exit "Error ZWEL0316E: Command requires zowe.useConfigmgr=true to use." "" 316
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then
# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/mvs/cli.js"

14 changes: 4 additions & 10 deletions bin/commands/init/security/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@
# Copyright Contributors to the Zowe Project.
#######################################################################

USE_CONFIGMGR=$(check_configmgr_enabled)
if [ "${USE_CONFIGMGR}" = "true" ]; then
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then

# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/security/cli.js"
else
print_error_and_exit "Error ZWEL0316E: Command requires zowe.useConfigmgr=true to use." "" 316
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then
# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/security/cli.js"
14 changes: 4 additions & 10 deletions bin/commands/init/stc/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,8 @@
# Copyright Contributors to the Zowe Project.
#######################################################################

USE_CONFIGMGR=$(check_configmgr_enabled)
if [ "${USE_CONFIGMGR}" = "true" ]; then
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then

# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/stc/cli.js"
else
print_error_and_exit "Error ZWEL0316E: Command requires zowe.useConfigmgr=true to use." "" 316
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then
# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/stc/cli.js"
13 changes: 4 additions & 9 deletions bin/commands/init/vsam/index.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,8 @@
# Copyright Contributors to the Zowe Project.
#######################################################################

USE_CONFIGMGR=$(check_configmgr_enabled)
if [ "${USE_CONFIGMGR}" = "true" ]; then
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then
# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/vsam/cli.js"
else
print_error_and_exit "Error ZWEL0316E: Command requires zowe.useConfigmgr=true to use." "" 316
if [ -z "${ZWE_PRIVATE_TMP_MERGED_YAML_DIR}" ]; then
# user-facing command, use tmpdir to not mess up workspace permissions
export ZWE_PRIVATE_TMP_MERGED_YAML_DIR=1
fi
_CEE_RUNOPTS="XPLINK(ON),HEAPPOOLS(OFF),HEAPPOOLS64(OFF)" ${ZWE_zowe_runtimeDirectory}/bin/utils/configmgr -script "${ZWE_zowe_runtimeDirectory}/bin/commands/init/vsam/cli.js"
7 changes: 4 additions & 3 deletions bin/libs/zos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ export function verifyGeneratedJcl(config:any): string {
if (!jcllib) {
return undefined;
}
// read JCL library and validate
let doesJclExist: boolean = zosDataset.isDatasetExists(jcllib);
const expectedMember = jcllib+'(ZWEIMVS)';
// read JCL library and validate using expected member ZWEIMVS (init mvs command)
let doesJclExist: boolean = zosDataset.isDatasetExists(expectedMember);
if (!doesJclExist) {
initGenerate.execute();
}
Expand All @@ -83,7 +84,7 @@ export function verifyGeneratedJcl(config:any): string {
const interval = [1,5,10,30];
for (let i = 0; i < interval.length; i++) {
let secs = interval[i];
doesJclExist=zosDataset.isDatasetExists(jcllib);
doesJclExist=zosDataset.isDatasetExists(expectedMember);
if (!doesJclExist) {
os.sleep(secs*1000);
} else {
Expand Down

0 comments on commit bb10e99

Please sign in to comment.