Closed wallnerryan closed 9 years ago
I really appreciate you trying to squeeze bugs out. There's likely plenty of them.
I'm not sure returning a empty list Is the correct way to go. Have been thinking of using exceptions instead or returning none/empty values/lists but haven't looked into it much more due to limited time.
no problem, and I can help with adding in exceptions as they are generally good practice, however, an empty list in this use case of deleting a volume is the correct behavior, as a volume with no SDC's should still be able to be deleted without causing and error when it has no SDCs mapped.
Fix get_sdc_for_volume so that it returns an empty list if there are no SDC's connected. This previous version would fail with
TypeError: 'NoneType' object is not iterable
when trying to do something like delete_volume if no SDCs were attached.