Hi Everyone,
We just found that the Volume.get_collection() method throws an exception when executed against a SVM containing restricted volumes.
Here is a function calling the method:
def getvolumeuuids(vserver, pattern):
uuidlist = []
try:
for volume in Volume.get_collection(**{"svm.name": vserver}, fields="*"):
if root_match(str(volume.name)):
continue
if reg_match(str(volume.name), pattern):
uuidlist.append(('{}'.format(volume.name), '{}'.format(volume.uuid), '{}'.format(volume.aggregates[0].name)))
except NetAppRestError as error:
print('Error: exception raised when calling Volume.get_collection for vserver {0}: [{1}]'.format(vserver, str(error)))
return []
else:
return uuidlist
When called given a vserver with restricted volumes, we get this error:
Error: exception raised when calling Volume.get_collection for vserver xxxxx-xxx-xxxx: [Caused by ValidationError({'state': ['"restricted" is not one of [\'error\', \'mixed\', \'offline\', \'online\']']},)]
The issue was found to exist within version 9.7.3 and 9.9.1 of the netapp_ontap package.
Can you please have a look at why the restricted status is not considered as a valid returned value?
Thanks
Pierre Kestremond