File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
Management-Utilities/fsx-ontap-aws-cli-scripts Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change 3535# ###############################################################################
3636waitForS3ApDelete () {
3737
38- local s3apName=$1
38+ local s3ApName=$1
39+ local volumeId=$2
3940 local MaxIterations=60
4041 local SleepTime=5
4142 #
@@ -46,7 +47,7 @@ waitForS3ApDelete () {
4647 if [ $? -eq 0 ]; then
4748 status=$( jq -r .S3AccessPointAttachments[0].Lifecycle $tmpout 2> /dev/null)
4849 if [ " $status " != " DELETING" -a " $status " != " PENDING" ]; then
49- printf " \nError, failed to delete volume with volume ID '$volumeId '. Status = ${status} .\n" 1>&2
50+ printf " \nError, failed to delete volume S3 endpoint $s3ApName attached to volume ID '$volumeId '. Status = ${status} .\n" 1>&2
5051 reason=" $( jq -r ' .S3AccessPointAttachments[0].LifecycleTransitionReason.Message' $tmpout 2> /dev/null) "
5152 if [ ! -z " $reason " ]; then
5253 echo " Reason: $reason " 1>&2
156157aws fsx describe-s3-access-point-attachments --filter " Name=volume-id,Values=$volumeId " --region=$region --output=json > $tmpout 2>&1
157158if [ " $( jq -r ' .S3AccessPointAttachments | length' $tmpout 2>&1 ) " != " 0" ]; then
158159 while read s3apName; do
159- [ $quiet != " true" ] && print " S3 Access Point '$s3apName ' is being deleted." 1>&2
160+ [ $quiet != " true" ] && printf " S3 Access Point '$s3apName ' is being deleted." 1>&2
160161 aws fsx detach-and-delete-s3-access-point --name $s3apName --region=$region --output=json > $tmpout 2>&1
161- if waitForS3ApDelete $s3apName ; then
162+ if waitForS3ApDelete $s3apName $volumeId ; then
162163 :
163164 else
164165 exit 1
165166 fi
166- [ $quiet != " true" ] && print " \n"
167+ [ $quiet != " true" ] && printf " \n"
167168 done < <( jq -r ' .S3AccessPointAttachments[] | .S3AccessPoint.ResourceARN | split("/")[1]' $tmpout 2> /dev/null)
168169fi
169170
You can’t perform that action at this time.
0 commit comments