use only the characters up to the last seen '_'

This commit is contained in:
reyesj2
2025-09-19 12:54:04 -05:00
parent 198695af03
commit f066baf6ba

View File

@@ -611,7 +611,7 @@ post_to_2.4.180() {
post_to_2.4.190() { post_to_2.4.190() {
# Only need to update import / eval nodes # Only need to update import / eval nodes
if [[ "$MINIONID" =~ "_import" ]] || [[ ! "$MINIONID" =~ "_eval" ]]; then if [[ "${MINIONID##*_}" == "import" ]] || [[ "${MINIONID##*_}" == "eval" ]]; then
update_import_fleet_output update_import_fleet_output
fi fi
@@ -1429,7 +1429,7 @@ main() {
if [ "$is_hotfix" == "true" ]; then if [ "$is_hotfix" == "true" ]; then
echo "Applying $HOTFIXVERSION hotfix" echo "Applying $HOTFIXVERSION hotfix"
# since we don't run the backup.config_backup state on import we wont snapshot previous version states and pillars # since we don't run the backup.config_backup state on import we wont snapshot previous version states and pillars
if [[ ! "$MINIONID" =~ "_import" ]]; then if [[ ! "${MINIONID##*_}" == "import" ]]; then
backup_old_states_pillars backup_old_states_pillars
fi fi
copy_new_files copy_new_files
@@ -1492,7 +1492,7 @@ main() {
fi fi
# since we don't run the backup.config_backup state on import we wont snapshot previous version states and pillars # since we don't run the backup.config_backup state on import we wont snapshot previous version states and pillars
if [[ ! "$MINIONID" =~ "_import" ]]; then if [[ ! "${MINIONID##*_}" == "import" ]]; then
echo "" echo ""
echo "Creating snapshots of default and local Salt states and pillars and saving to /nsm/backup/" echo "Creating snapshots of default and local Salt states and pillars and saving to /nsm/backup/"
backup_old_states_pillars backup_old_states_pillars