Ask Your Question
0

create tenant can not find endpoint

asked 2015-09-18 04:11:50 -0500

anonymous user

Anonymous

Hi all:

When I execute blow codes:

 from keystoneclient.v2_0 import client
username='admin'
password='123456'
tenant_name='admin'
auth_url='http://************:5000/v2.0/'
keystone=client.Client(username=username, password=password,tenane_name=tenant_name,auth_url=auth_url,debug=True)
dir(keystone.tenants)
tenant = keystone.tenants.create(tenant_name="openstackDemo", description="My new tenant!", enabled=True, debug=True)

It come out :

  keystoneclient.openstack.common.apiclient.exceptions.EndpointNotFound

But I think I have created the endpoint.

+----------------------------------+-----------+--------------------------------------+---------------------------------+---------------------------------+----------------------------------+
|                id                |   region  |              publicurl               |           internalurl           |             adminurl            |            service_id            |
+----------------------------------+-----------+--------------------------------------+---------------------------------+---------------------------------+----------------------------------+
| 0198d2a86fca4e44bbf9a408723aafc0 | regionOne |   http://23.246.252.234:5000/v2.0    | http://23.246.252.234:5000/v2.0 | http://23.246.252.234:5000/v2.0 | 7c3f23149b7a44f0abf1c49ec4b381be |

I do not what is wrong

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-09-22 01:46:25 -0500

dbaxps gravatar image

updated 2015-09-22 01:47:14 -0500

Syntax working for me on Kilo and Liberty :

root@ip-192-169-142-127 ~]# python
Python 2.7.5 (default, Jun 24 2015, 00:41:19) 
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from keystoneclient.v2_0 import client
>>> token = '3ad2de159f9649afb0c342ba57e637d9'
>>> endpoint = 'http://192.169.142.127:35357/v2.0'
>>> keystone = client.Client(token=token, endpoint=endpoint)
>>> keystone.tenants.create(tenant_name="openstackDemo",description="Default Tenant", enabled=True)
<Tenant {u'enabled': True, u'description': u'Default Tenant', u'name': u'openstackDemo', u'id': u'6e6fde29b88443b9bb603030a548e9c3'}>
>>>

Verification via deprecated CLI

# keystone tenant-list
+----------------------------------+---------------+---------+
|                id                |      name     | enabled |
+----------------------------------+---------------+---------+
| 21c46e5eef01460e85b94cce4a11f2e4 |     admin     |   True  |
| 1b56b8d970a347abac8b49c630a034a3 |      demo     |   True  |
| 6e6fde29b88443b9bb603030a548e9c3 | openstackDemo |   True  |
| bba28301cd69444b9f142f4f8c20dbf1 |    services   |   True  |
+----------------------------------+---------------+---------+

Next

# cat /etc/keystone/keystone/conf
#
#admin_token = ADMIN
admin_token = 3ad2de159f9649afb0c342ba57e637d9
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-09-18 04:11:50 -0500

Seen: 64 times

Last updated: Sep 22 '15