- # For debugging only; this outout usually disabled
- # echo "${uuid} created at ${created_at} / ${created_at_uxts} / cutoff: ${cutoff}"
-
- # Validate timing values are numeric
- if [[ "$created_at_uxts" -eq "$created_at_uxts" ]]; then
- # Clean up objects when created_at > specified age
- if [[ "$created_at_uxts" -lt "$cutoff" ]]; then
- echo "Removing orphaned ${object} $uuid created $created_at_uxts > $age"
- openstack --os-cloud "$os_cloud" "${object}" delete "$uuid"
- fi
- else
- echo "Date variable failed numeric test; deletion not possible"
+ # Cleanup objects where created_at is older than specified cutoff time
+ # created_at_uxts is measured against UNIX epoch; lower values are older
+ if [[ "$created_at_uxts" -lt "$cutoff" ]]; then
+ echo "Removing orphaned ${object} $uuid created $created_at_uxts > $age"
+ openstack --os-cloud "$os_cloud" "${object}" delete "$uuid"