Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just continuing testing more sample scripts...some obstacles. #33

Closed
ashwinwriter opened this issue Dec 21, 2021 · 2 comments
Closed

Just continuing testing more sample scripts...some obstacles. #33

ashwinwriter opened this issue Dec 21, 2021 · 2 comments

Comments

@ashwinwriter
Copy link

Hi,

Following 2 scripts gave me following errors:

[root@centos9 /]# python3.9 file_system_analytics.py --c x.x.x.x -u admin -p xxxxxx
Traceback (most recent call last):
File "//file_system_analytics.py", line 26, in
from utils import get_key_volumes, show_svm, show_volume
ImportError: cannot import name 'get_key_volumes' from 'utils' (/utils.py)

[root@centos9 /]# python3.9 nfs_setup.py -c x.x.x.x -u admin -p xxxxxx
Traceback (most recent call last):
File "//nfs_setup.py", line 26, in
from utils import setup_connection, get_size, get_key_svms, show_svm
ImportError: cannot import name 'get_key_svms' from 'utils' (/utils.py)

[root@centos9 /]# python3.9 cifs_setup.py -c x.x.x.x -u admin -p xxxxxx
Traceback (most recent call last):
File "//cifs_setup.py", line 160, in
main()
File "//cifs_setup.py", line 154, in main
headers = setup_connection(args.api_user, args.api_pass)
TypeError: setup_connection() missing 1 required positional argument: 'api_pass'

Thanks!

@RobertBlackhart
Copy link
Contributor

You might be mixing scripts. There are two main directories of examples in this repo. One is rest_api and these examples use the requests library directly to make API calls to ONTAP. This rest_api directory has in it a utils.py file that contains the get_key_volumes() function that it being referred to in that first error.

The other directory is python_client_library and these examples make use of the netapp_ontap library (a NetApp published library) to make API calls. This directory has a separate utils.py file in it whose contents are a little different.

I would say, make sure you're running scripts from the right directory so that the utils that gets imported is the right one.

@ashwinwriter
Copy link
Author

ashwinwriter commented Dec 22, 2021 via email

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

No branches or pull requests

2 participants