2nd example: when polling a status with 5 seconds interval (= KeepAliveTimeout=5), the API request eventually fails with a fatal error. It's known to happen when the interval is exactly the same as KeepAliveTimeout discussed in multiple places, e.g. https://github.com/psf/requests/issues/4664 https://bugs.python.org/issue41345
2nd example: when polling a status with 5 seconds interval (= KeepAliveTimeou t=5), the API request eventually fails with a fatal error. It's known to happen when the interval is exactly the same as KeepAliveTimeout discussed in multiple places, e.g. /github. com/psf/ requests/ issues/ 4664 /bugs.python. org/issue41345
https:/
https:/
https:/ /docs.openstack .org/python- keystoneclient/ latest/ using-sessions. html identity import v3
====
from keystoneauth1.
from keystoneauth1 import session
from keystoneclient.v3 import client
import logging
logging. basicConfig( level=logging. DEBUG)
from time import sleep
auth = v3.Password( auth_url= "https:/ /192.168. 151.112: 5000/v3",
username= "admin" , password= "MY_PASSWORD" ,
project_ name="admin" ,
user_ domain_ name="admin_ domain" ,
project_ domain_ name="admin_ domain" )
sess = session. Session( auth=auth, "/home/ ubuntu/ snap/openstackc lients/ common/ root-ca. crt") Client( session= sess)
verify=
keystone = client.
while True: projects. list()
keystone.
sleep(5)
====
...
DEBUG:keystonea uth.session: GET call to identity for https:/ /192.168. 151.112: 35357/v3/ projects used request id req-37b4e617- 3272-440e- 90fe-bbfcebe0c8 65 4dc28e51d52ccd4 968c3, is_domain=False, links={'self': 'https:/ /192.168. 151.112: 5000/v3/ projects/ 32035470a7104dc 28e51d52ccd4968 c3'}, name=services, options={}, parent_id=default, tags=[]>, <Project description=Created by Juju, domain_ id=fcc7fc21bd35 421d9ceb4a9c089 0f527, enabled=True, id=33d9a30eec2a 4902b220ea07987 46be9, is_domain=False, links={'self': 'https:/ /192.168. 151.112: 5000/v3/ projects/ 33d9a30eec2a490 2b220ea0798746b e9'}, name=services, options={}, parent_ id=fcc7fc21bd35 421d9ceb4a9c089 0f527, tags=[]>, <Project description=Created by Juju, domain_ id=29e509050afa 4cc2b235eabb9e8 6a8ff, enabled=True, id=75f15e43071a 49f488291b95b62 45711, is_domain=False, links={'self': 'https:/ /192.168. 151.112: 5000/v3/ projects/ 75f15e43071a49f 488291b95b62457 11'}, name=admin, options={}, parent_ id=29e509050afa 4cc2b235eabb9e8 6a8ff, tags=[]>, <Project description= Bootstrap project for initializing the cloud., domain_id=default, enabled=True, id=acd0dacb4836 4de386d8a5faea4 7b6cf, is_domain=False, links={'self': 'https:/ /192.168. 151.112: 5000/v3/ projects/ acd0dacb48364de 386d8a5faea47b6 cf'}, name=admin, options={}, parent_id=default, tags=[]>] uth.session: REQ: curl -g -i --cacert "/home/ ubuntu/ snap/openstackc lients/ common/ root-ca. crt" -X GET https:/ /192.168. 151.112: 35357/v3/ projects? -H "Accept: application/json" -H "User-Agent: python- keystoneclient" -H "X-Auth-Token: {SHA256} dff1fb0579fd35b fe46ef6574aadfd a8993582d4ea251 4e13fed16c181de c24d" python3/ dist-packages/ urllib3/ connectionpool. py", line 665, in urlopen response = self._make_request( python3/ dist-packages/ urllib3/ connectionpool. py", line 421, in _make_request raise_from( e, None) python3/ dist-packages/ urllib3/ connectionpool. py", line 416, in _make_request response = conn.getresponse() python3. 8/http/ client. py", line 1344, in getresponse begin() python3. 8/http/ client. py", line 307, in begin python3. 8/http/ client. py", line 276, in _read_status ted("Remote end closed connection without" RemoteDisconnec ted: Remote end closed connection without response
[<Project description=Created by Juju, domain_id=default, enabled=True, id=32035470a710
DEBUG:keystonea
Traceback (most recent call last):
File "/usr/lib/
httplib_
File "/usr/lib/
six.
File "<string>", line 3, in raise_from
File "/usr/lib/
httplib_
File "/usr/lib/
response.
File "/usr/lib/
version, status, reason = self._read_status()
File "/usr/lib/
raise RemoteDisconnec
http.client.