Python Discussions

FileDirectorySecurity call in Python library not returning anything

Greg_pebkac

We have just upgraded to ONTAP 9.9.1 so I upgraded our Python library to 9.9.1 as I need to retrieve/update the NTFS permissions using the FileDirectorySecurity module.

However when I perform a get I'm not getting any return.
The call isn't erroring out even when I use incorrect filters.
Example of code ( which is direct copy from the documentation - https://library.netapp.com/ecmdocs/ECMLP2876965/html/resources/file_directory_security.html)
###
resource = FileDirectorySecurity(path="na_student_videos",**{"svm.uuid": "2059c57e-04b3-11e9-a63b-00a09899b75b"})
resource.get
print (resource)
###

When I test the REST API call using curl it returns data as expected.
curl -u XXXX -X GET "https://array-name/api/protocols/file-security/permissions/2059c57e-04b3-11e9-a63b-00a09899b75b/%2Fna_student_videos/?fields=acls&return_records=true&..." -H "accept application/hal+json"

Has anyone used the FileDirectorySecurity module or can provide advice on why it's not working.

1 ACCEPTED SOLUTION

Greg_pebkac

I've had a response from the NetApp developers and they have confirmed that this is a bug in the library code to be fixed in a future release.
In the meantime will need to use the python requests library for the endpoint (api/protocols/file-security/permissions) to retrieve the information.
Unfortunately that means recoding my scripting and having to use different methodology to the other calls as I am trying to use the python module.

View solution in original post

2 REPLIES 2

Greg_pebkac

I've had a response from the NetApp developers and they have confirmed that this is a bug in the library code to be fixed in a future release.
In the meantime will need to use the python requests library for the endpoint (api/protocols/file-security/permissions) to retrieve the information.
Unfortunately that means recoding my scripting and having to use different methodology to the other calls as I am trying to use the python module.

tahmad

Thank you for the update @Greg_pebkac 

Public