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

TypeError: The 'search' parameter should be of type 'str', but it is of type 'unicode'. #71

Open
pureinfosystems opened this issue Dec 1, 2021 · 2 comments · May be fixed by #78
Open

Comments

@pureinfosystems
Copy link

I am using version 4.3 script to backup 4.3 ovirt environment but received following error.

Traceback (most recent call last):
File "/opt/ovirtbackup/backup.py", line 464, in
main(sys.argv[1:])
File "/opt/ovirtbackup/backup.py", line 223, in main
if system_service.data_centers_service().list(search='name=%s' % config.get_datacenter_name() )[0] is None:
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/services.py", line 6507, in list
('search', search, str),
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 191, in _check_types
raise TypeError(' '.join(messages))
TypeError: The 'search' parameter should be of type 'str', but it is of type 'unicode'.

@tatref tatref linked a pull request Jan 12, 2022 that will close this issue
@tatref
Copy link
Contributor

tatref commented Jan 12, 2022

Probably because of python2.7, which handles string differently than python3

See #78 for fix

@pureinfosystems
Copy link
Author

After I updated the backup.py with suggested changes, I continue to receive following error.

Traceback (most recent call last):
File "./backup.py", line 466, in
main(sys.argv[1:])
File "./backup.py", line 223, in main
if system_service.data_centers_service().list(search='name=%s' % config.get_datacenter_name() )[0] is None:
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/services.py", line 6507, in list
('search', search, str),
File "/usr/lib64/python2.7/site-packages/ovirtsdk4/service.py", line 191, in _check_types
raise TypeError(' '.join(messages))
TypeError: The 'search' parameter should be of type 'str', but it is of type 'unicode'.

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

Successfully merging a pull request may close this issue.

2 participants