From e2d2073d0d1ada59141c8fc364d6ea9f6ab873a3 Mon Sep 17 00:00:00 2001 From: 1000TurquoisePogs Date: Thu, 8 Feb 2024 16:13:09 -0500 Subject: [PATCH] Reduce duplicate code in each init phase Signed-off-by: 1000TurquoisePogs --- bin/commands/init/mvs/index.sh | 15 +++++++++++++-- bin/libs/zos.sh | 1 + 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/commands/init/mvs/index.sh b/bin/commands/init/mvs/index.sh index 3176c4917a..bcfc0f3ede 100644 --- a/bin/commands/init/mvs/index.sh +++ b/bin/commands/init/mvs/index.sh @@ -62,11 +62,22 @@ while read -r line; do else print_error_and_exit "Error ZWEL0157E: ${name} (zowe.setup.dataset.${key}) is not defined in Zowe YAML configuration file." "" 157 fi - elif [ "${key}" = "authLoadlib" ]; then - if [ "${ds}" = "${prefix}.SZWESAMP" ]; then + fi + + if [ "${key}" = "authLoadlib" ]; then + if [ "${ds}" = "${prefix}.SZWEAUTH" ]; then run_aloadlib_create="false" else run_aloadlib_create="true" + # check existence + ds_existence=$(is_data_set_exists "${ds}") + if [ "${ds_existence}" = "true" ]; then + if [ "${ZWE_CLI_PARAMETER_ALLOW_OVERWRITE}" = "true" ]; then + print_message "Warning ZWEL0300W: ${ds} already exists. Members in this data set will be overwritten." + else + print_message "Warning ZWEL0301W: ${ds} already exists and will not be overwritten. For upgrades, you must use --allow-overwrite." + fi + fi fi fi diff --git a/bin/libs/zos.sh b/bin/libs/zos.sh index e4df74e779..8e3eb5ebc3 100644 --- a/bin/libs/zos.sh +++ b/bin/libs/zos.sh @@ -75,6 +75,7 @@ verify_generated_jcl() { result=$(zwecli_inline_execute_command init generate) fi + # should be created, but may take time to discover. if [ -z "${does_jcl_exist}" ]; then does_jcl_exist= for secs in 1 5 10 ; do