Bug 1018559

Summary: [RHEVM-SDK-PYTHON]: support automatic auth session invalidation
Product: Red Hat Enterprise Virtualization Manager Reporter: Michael Pasternak <mpastern>
Component: ovirt-engine-sdkAssignee: Juan Hernández <juan.hernandez>
Status: CLOSED CURRENTRELEASE QA Contact: movciari
Severity: high Docs Contact:
Priority: unspecified    
Version: 3.4.0CC: aberezin, bazulay, iheim, juan.hernandez, oramraz, pstehlik, rbalakri, Rhev-m-bugs, rhodain, talayan, yeylon
Target Milestone: ---Keywords: Reopened
Target Release: 3.5.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard: infra
Fixed In Version: rhevm-sdk-python-3.5.0.2-1.el6_5 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-02-16 13:36:39 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: 1018561, 1142923, 1156165    

Description Michael Pasternak 2013-10-13 10:31:37 UTC
Description of problem:

latest REST-API supports automatic auth session invalidation (upon expiry), sdk should expose this capability as well.

Comment 7 Itamar Heim 2014-06-12 14:06:08 UTC
Closing as part of 3.4.0

Comment 8 Juan Hernández 2014-06-16 11:00:41 UTC
*** Bug 1109709 has been marked as a duplicate of this bug. ***

Comment 9 Roman Hodain 2014-06-16 12:26:15 UTC
Hello,

I have tested this feature, but I am still hitting the same issue.

    rhevm-sdk-python-3.4.1.0-2

The following script was started and then ovirt-engine rstart was triggered.

==================================
#!/usr/bin/python
import sys
import time
from ovirtsdk.api import API    
    
USERNAME="admin@internal"
PASSWORD="password"
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,
			renew_session=True)
		print "Connection Ok..."
	except Exception as e:
		print "Connection failure: %s" % str(e)
	time.sleep(5)

====================================


RESULT:
====================================
# ./test.py
Connection Ok...
Connection failure: 
status: 503
reason: Service Temporarily Unavailable
detail: 
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>503 Service Temporarily Unavailable</title>
</head><body>
<h1>Service Temporarily Unavailable</h1>
<p>The server is temporarily unable to service your
request due to maintenance downtime or capacity
problems. Please try again later.</p>
<hr>
<address>Apache/2.2.22 (Red Hat Enterprise Web Server) Server at vm-236.gsslab.brq.redhat.com Port 443</address>
</body></html>

Connection failure: 
status: 404
reason: Not Found
detail: 
Connection failure: [ERROR]::oVirt sdk is disconnected from the server.
Connection failure: [ERROR]::oVirt sdk is disconnected from the server.
Connection failure: [ERROR]::oVirt sdk is disconnected from the server.
Connection failure: [ERROR]::oVirt sdk is disconnected from the server.
....
====================================

The manager is already UP and reachable by the same script if started from another terminal.

Comment 10 Juan Hernández 2014-07-08 16:23:30 UTC
The fix for bug 1116009 fixes this bug as well.