Comment 3 for bug 1020326

Revision history for this message
Tihomir Trifonov (ttrifonov) wrote :

Here are 2 possible solutions, but none of them is perfect..

1. Load all snapshost on page load and allow the 'Delete' action only of there is no Snapshot with the specified volume id.
  Pros - we will hide 'Delete' button for volumes that cannot be deleted.
  Cons - when trying to delete a volume using the Table 'Delete' Action and 'select-all' checkbox, an error will be displayed: "You do not have permissions to delete volume: xxxx', which is misleading a bit...

2. Catch the exception on 'delete()' and process it to see if it is caused by an existing snapshot.
  Pros - this works on delete, no need to pre-load anything.
  Cons - needs some refactoring for BatchAction class, as it ignores the exception error. It might be fixed to work with 2 errors, but.. again not the perfect solution.