starting keystone-all and immediately trying to use it doesn't work
[root@test ~]# /bin/systemctl stop openstack-keystone.service ; /bin/systemctl start openstack-keystone.service ; /usr/bin/keystone --token keystone_admin_token --endpoint http://127.0.0.1:35357/v2.0/ service-list
Unable to communicate with identity service: 'NoneType' object has no attribute 'makefile'. (HTTP 400)
Adding a delay allows it to work
[root@test ~]# /bin/systemctl stop openstack-keystone.service ; /bin/systemctl start openstack-keystone.service ; sleep 1 ; /usr/bin/keystone --token keystone_admin_token --endpoint http://127.0.0.1:35357/v2.0/ service-list
+----------------------------------+-------------+----------+----------------------------+
| id | name | type | description |
+----------------------------------+-------------+----------+----------------------------+
| 47b13f0377844c0598ea375f6f8c2c63 | keystone | identity | OpenStack Identity Service |
| 6fc27a24ae9646c982ad5d5936a970b1 | nova_ec2 | ec2 | EC2 service |
| 92f587177d514120b28333b2ebc9da7d | glance | image | Openstack Image Service |
| 9876ca7d32d14d52b95be0de9cde1933 | nova_volume | volume | Volume Service |
| e80fd93a16554794b04c12153eb8ec0e | nova | compute | Openstack Compute Service |
+----------------------------------+-------------+----------+----------------------------+
This is a problem in automated environments e.g. puppet