Bug 1365910

Summary: ovirtsdk.api.API in ovirt-engine-sdk-python 3.6.x does not accept Unicode passwords
Product: Red Hat Enterprise Virtualization Manager Reporter: Petr Spacek <pspacek>
Component: ovirt-engine-sdk-pythonAssignee: Ondra Machacek <omachace>
Status: CLOSED ERRATA QA Contact: Lucie Leistnerova <lleistne>
Severity: high Docs Contact:
Priority: high    
Version: 3.6.8CC: gklein, juan.hernandez, mgoldboi, mperina
Target Milestone: ovirt-3.6.9Keywords: Rebase, Regression, ZStream
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rhevm-sdk-python-3.6.9.1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-09-21 17:55:07 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: Infra RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1213937    

Description Petr Spacek 2016-08-10 13:20:37 UTC
Description of problem:
Previously, ovirt-engine-sdk-python 3.5.x provided API object ovirtsdk.api.API which accepted Unicode "password" parameter in its constructor.

ovirt-engine-sdk-python 3.6.x now fails to initialize the API with cryptic error instead of accepting the password as it did before.


Version-Release number of selected component (if applicable):
ovirt-engine-sdk-python-3.6.8.0-1.el7ev
python-pycurl-7.19.0-19.el7.x86_64
curl-7.29.0-32.el7.x86_64
libcurl-7.29.0-32.el7.x86_64

How reproducible:
100 %

Steps to Reproduce:
1. Install ovirt-engine-sdk-python-3.6.8.0-1.el7ev
2. Attempt to initialize RHEV API using Unicode password:
$ python -c 'import ovirtsdk.api; ovirtsdk.api.API("https://rhevm.abc.idm.lab.eng.brq.redhat.com", insecure=True, password=u"blah")'

Actual results:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/ovirtsdk/api.py", line 191, in __init__
    url=''
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/proxy.py", line 122, in request
    persistent_auth=self.__persistent_auth
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/connectionspool.py", line 79, in do_request
    persistent_auth)
  File "/usr/lib/python2.7/site-packages/ovirtsdk/infrastructure/connectionspool.py", line 97, in __do_request
    self.__curl.setopt(pycurl.USERPWD, "%s:%s" % (self.__username, self.__password))
TypeError: invalid arguments to setopt


Expected results:
It should work as in 3.5.x SDK.

Comment 1 Petr Spacek 2016-08-10 13:51:07 UTC
Interestingly, it works even if I install ovirt-engine-sdk-python-3.6.8.0-1.el7ev.noarch to Fedora 24.

On RHEL 7 it works with rhevm-sdk-python-3.5.6.0-1.el7ev.noarch. It stops working as soon as I upgrade to rhevm-sdk-python-3.6.0.0-1.el7ev.noarch (while not changing any other packages!).

Comment 5 Lucie Leistnerova 2016-09-12 08:15:09 UTC
verified in rhevm-sdk-python-3.6.9.1-1.el6ev.noarch

Comment 7 errata-xmlrpc 2016-09-21 17:55:07 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2016-1923.html