Skip to content

Commit

Permalink
Merge pull request #100 from scality/feature/improve_ovh_cleanup
Browse files Browse the repository at this point in the history
Improve ovh vm cleanup
  • Loading branch information
Alexandre Lavigne committed Sep 8, 2023
2 parents 2f51aa5 + cf42a0a commit b0668b2
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion actions-cleanup-openstack-vms/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,14 @@ runs:
creation_time=$(openstack server show -f value -c created "$vm")
timestamp=$(date -d "$creation_time" +%s)
if [ "$timestamp" -lt "$delta" ]; then
openstack server delete "$vm" --wait --verbose --wait
set +e
openstack server delete "$vm" --wait --verbose
if [ $? -eq 0 ]; then
echo "VM '$vm' deletion successful"
else
echo "VM '$vm' deletion failed"
fi
set -e
fi
done
echo echo ":rocket: Cleanup of VMs older that ${{ inputs.AGE_HOURS }} hours successful" >> $GITHUB_STEP_SUMMARY
Expand Down

0 comments on commit b0668b2

Please sign in to comment.