Skip to content

Add delete_isilon_allocation utility function#474

Open
claire-peters wants to merge 1 commit into
masterfrom
feature/isilon-delete-allocation
Open

Add delete_isilon_allocation utility function#474
claire-peters wants to merge 1 commit into
masterfrom
feature/isilon-delete-allocation

Conversation

@claire-peters

Copy link
Copy Markdown
Collaborator

Summary

  • Adds delete_isilon_allocation(resource_url, path, force=False) to coldfront/plugins/isilon/utils.py
  • Discovers and deletes all items associated with an allocation (quota, snapshot schedule, SMB share, NFS export, Lab/Everyone subdirectories, root directory), skipping gracefully any that don't exist
  • Refuses to proceed if the quota reports non-zero physical usage
  • Prints a full list of what will be deleted and requires the user to type "yes" to confirm
  • path matches the Subdirectory allocation attribute (e.g. rc_labs/smithlab), lab name is derived from the last path component
  • Intended for interactive shell use to clean up after a failed allocation creation

Test plan

  • Call from Django shell against a test cluster with all items present — confirm preview output and deletion
  • Call with some items absent (e.g. no snapshot schedule) — confirm absent items are skipped silently
  • Call against a path with non-zero quota usage — confirm ValueError is raised before any deletion occurs
  • Type anything other than "yes" at the prompt — confirm nothing is deleted

Adds a standalone function for cleaning up after a failed allocation
creation. Given a resource URL and Subdirectory path (e.g. rc_labs/smithlab),
it discovers and deletes the quota, snapshot schedule, SMB share, NFS export
(each only if present), Lab/Everyone subdirectories, and root lab directory.

Refuses to proceed if the quota reports non-zero physical usage, and
requires explicit confirmation before any destructive operation.
Intended for interactive shell use via the Django shell or a script.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant