Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1695920 - API script to list clusters fails with error 'ValueError: urandom is not a valid RngSource'
Summary: API script to list clusters fails with error 'ValueError: urandom is not a va...
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Red Hat Enterprise Virtualization Manager
Classification: Red Hat
Component: ovirt-engine-sdk-python
Version: 4.2.8
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Ondra Machacek
QA Contact: meital avital
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-04-03 22:07 UTC by Abhishekh Patil
Modified: 2019-04-10 21:48 UTC (History)
2 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-04-10 21:48:31 UTC
oVirt Team: Infra
Target Upstream Version:


Attachments (Terms of Use)

Description Abhishekh Patil 2019-04-03 22:07:37 UTC
Description of problem:
API script to list clusters fails with below error:
~~~~~
    clusters = clusters_service.list()
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/services.py", line 3819, in list
    return readers.ClusterReader.read_many(reader)
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/readers.py", line 1787, in read_many
    objs.append(ClusterReader.read_one(reader))
  File "/usr/lib64/python2.7/site-packages/ovirtsdk4/readers.py", line 1740, in read_one
    obj.required_rng_sources = [types.RngSource(s.lower()) for s in Reader.read_strings(reader)]
  File "/usr/lib/python2.7/site-packages/enum/__init__.py", line 330, in __call__
    return cls.__new__(cls, value)
  File "/usr/lib/python2.7/site-packages/enum/__init__.py", line 642, in __new__
    raise ValueError("%s is not a valid %s" % (value, cls.__name__))
ValueError: urandom is not a valid RngSource
~~~~~


Version-Release number of selected component (if applicable):
python-ovirt-engine-sdk4-4.2.9-1.el7ev.x86_64
ovirt-engine-4.2.8.5-0.1.el7ev.noarch

How reproducible:
[100%]

Steps to Reproduce:
1. Create a script as mentioned on RHV-Manager and execute it:
~~~~~~~~~
import ovirtsdk4 as sdk
import ovirtsdk4.types as types
import getpass

connection = sdk.Connection(
    url='https://<FQDN>/ovirt-engine/api',
    username='admin@internal',
    password=getpass.getpass('Please enter user password: '),
    ca_file='/etc/pki/ovirt-engine/ca.pem',
)
system_service = connection.system_service()
clusters_service = system_service.clusters_service()

clusters = clusters_service.list()

for cl in clusters:
    print("%s (%s)" % (cl.name, cl.id))

connection.close()
~~~~~~~


Actual results:
Script fails with error 'ValueError: urandom is not a valid RngSource'

Expected results:
Script should work.

Comment 4 Gordon Watson 2019-04-10 21:48:31 UTC
It turns out that 'python-ovirt-engine-sdk4-4.2.9-1.el7ev.x86_64' was not being used after all, and instead an older version was being used. When the Python SDK package was upgraded, the problem no longer occurred.

Closing as NOTABUG.


Note You need to log in before you can comment on or make changes to this bug.