Description of problem: python SDK is not able to reconnect after a connection failure. Version-Release number of selected component (if applicable): rhevm-sdk-python-3.4.1.0-2.el6ev.noarch How reproducible: 100% Steps to Reproduce: Run the following script on the RHEV-M and restart the engine. Or shutdown the manger and then start the script. ======================================= #!/usr/bin/python import sys import time from ovirtsdk.api import API USERNAME="admin@internal" PASSWORD="password" TAG='AlwaysUp' CA_FILE="/etc/pki/ovirt-engine/ca.pem" URL="https://FQDN/api" while True: try: api_instance = API(url=URL, username=USERNAME, password=PASSWORD, ca_file=CA_FILE) print "Connection Ok..." except Exception as e: print "Connection failure: %s" % str(e) time.sleep(5) ====================================== Actual results: [ERROR]::oVirt sdk is disconnected from the server. Expected results: SDK is able to reconnect
The constructor of the SDK has a "renew_session" parameter that enables automatic re-connection. The default values is False, so you need to include it explicitly in the call to the constructor: api_instance = API(url=URL, username=USERNAME, password=PASSWORD, ca_file=CA_FILE, renew_session=True) *** This bug has been marked as a duplicate of bug 1018559 ***