Ask Your Question
0

whole CLI doesnt work anymore. (Kilo)

asked 2015-10-15 03:15:43 -0500

mickey gravatar image

Hi. Today i wanted to make some tests after finished installation of 3 node setup Openstack. I wanted to check out if everything works and saw that Keystone is Deprecated. Its not showing anything else than this error:

/usr/local/lib/python2.7/dist-packages/keystoneclient/shell.py:64: DeprecationWarning: The keystone CLI is deprecated in favor of python-openstackclient. For a Python library, continue using python-keystoneclient.
  'python-keystoneclient.', DeprecationWarning)
/usr/local/lib/python2.7/dist-packages/keystoneclient/v2_0/client.py:145: DeprecationWarning: Constructing an instance of the keystoneclient.v2_0.client.Client class without a session is deprecated as of the 1.7.0 release and may be removed in the 2.0.0 release.
  'the 2.0.0 release.', DeprecationWarning)
/usr/local/lib/python2.7/dist-packages/keystoneclient/v2_0/client.py:147: DeprecationWarning: Using the 'tenant_name' argument is deprecated in version '1.7.0' and will be removed in version '2.0.0', please use the 'project_name' argument instead
  super(Client, self).__init__(**kwargs)
/usr/local/lib/python2.7/dist-packages/debtcollector/renames.py:43: DeprecationWarning: Using the 'tenant_id' argument is deprecated in version '1.7.0' and will be removed in version '2.0.0', please use the 'project_id' argument instead
  return f(*args, **kwargs)
/usr/local/lib/python2.7/dist-packages/keystoneclient/httpclient.py:376: DeprecationWarning: Constructing an HTTPClient instance without using a session is deprecated as of the 1.7.0 release and may be removed in the 2.0.0 release.
  'the 2.0.0 release.', DeprecationWarning)
Authorization Failed: The resource could not be found. (HTTP 404) (Request-ID: req-c186151c-725f-4e43-8112-976b02ce66e2)

When i use the Openstack CLI:

ERROR: openstackclient.shell Exception raised: (pbr 1.6.0 (/usr/local/lib/python2.7/dist-packages), Requirement.parse('pbr>=0.6,!=0.7,<1.0'))

I downgraded and upgraded the pbr with any success. I even made python install --upgrade python-keystoneclient. Same for the Openstackclient ... What could fail? i made anything than just running 1 Instance.

edit retag flag offensive close merge delete

3 answers

Sort by ยป oldest newest most voted
1

answered 2015-10-15 05:42:14 -0500

mickey gravatar image

updated 2015-10-15 06:33:33 -0500

UPDATE

After (pip install --upgrade python-openstackclient) and now the openstack cli works fine.

But Keystone still has the same trouble as mentioned.

the python thing didnt help

Python 2.7.6 (default, Jun 22 2015, 17:58:13) 
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from keystoneclient.v2.0 import client
  File "<stdin>", line 1
    from keystoneclient.v2.0 import client
                           ^
SyntaxError: invalid syntax
>>> from keystoneclient.v2_0 import client
>>> token = '4f87d15d7fae4325653b'
>>> endpoint = 'http://controller:35357/v2.0'
>>> keystone = client.Client(token=token, endpoint=endpoint)
>>> keystone.tenants.list()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/dist-packages/keystoneclient/v2_0/tenants.py", line 123, in list
    tenant_list = self._list('/tenants%s' % query, 'tenants')
  File "/usr/local/lib/python2.7/dist-packages/keystoneclient/base.py", line 124, in _list
    resp, body = self.client.get(url, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keystoneclient/adapter.py", line 170, in get
    return self.request(url, 'GET', **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keystoneclient/adapter.py", line 206, in request
    resp = super(LegacyJsonAdapter, self).request(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keystoneclient/adapter.py", line 95, in request
    return self.session.request(url, method, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keystoneclient/utils.py", line 337, in inner
    return func(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/keystoneclient/session.py", line 402, in request
    raise exceptions.from_response(resp, method, url)
keystoneclient.exceptions.Unauthorized: The request you have made requires authentication. (HTTP 401) (Request-ID: req-09ef6fdc-d177-4da1-94c1-7a6702006253)
edit flag offensive delete link more

Comments

Source admin credentials to shell before loading python interpretator

dbaxps gravatar imagedbaxps ( 2015-10-15 06:45:34 -0500 )edit

dbaxps's code works fine under keystone v1.6.0. Are you sure that the token issued is correct? Mine is the same as that in dbaxps's code, a 32-character string.

Cheng Liu gravatar imageCheng Liu ( 2015-10-15 07:01:40 -0500 )edit

Yes, credentials doesn't matter, token seems to be wrong.

dbaxps gravatar imagedbaxps ( 2015-10-15 07:11:18 -0500 )edit

just wanted to note, I was having the same issue after installing ceilometermiddleware with pip. (https://ask.openstack.org/en/question/83156/installing-ceilometermiddleware-via-pip-breaks-openstack-cli/ (https://ask.openstack.org/en/question...))

pip install --upgrade python-openstackclient

fixed my issue with openstack-cli

dubious gravatar imagedubious ( 2015-10-15 17:30:26 -0500 )edit
0

answered 2015-10-15 04:04:19 -0500

dbaxps gravatar image

updated 2015-10-15 04:15:42 -0500

See http://docs.openstack.org/developer/p...
Using the V2 client API
It requires minimal python writing skills. It works for me.

[root@CentOS71Server ~(keystone_admin)]# 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 = '9b8343175a9740389d6c6b35b36937be'
>>> endpoint = 'http://192.168.1.92:35357/v2.0'
>>> keystone = client.Client(token=token, endpoint=endpoint)
>>> keystone.tenants.list()
[<Tenant {u'enabled': True, u'description': u'default tenant', u'name': u'demo', u'id': u'3d3251ded8f740eeb7897709a33199ff'}>, <Tenant {u'enabled': True, u'description': u'admin tenant', u'name': u'admin', u'id': u'51d4917adf41417a9f9b36ea6066ce2b'}>, <Tenant {u'enabled': True, u'description': u'Tenant for the openstack services', u'name': u'services', u'id': u'd7264f247c8a4f679cc50bec846742e5'}>]

For token value see your /etc/keystone/keystone.conf. It's right in the top.

edit flag offensive delete link more
0

answered 2015-10-15 03:21:46 -0500

Cheng Liu gravatar image

updated 2015-10-15 07:18:51 -0500

It is saying that the problem is related to pbr version. Install pbr version between 0.6.0 and 1.0 would probably solve it.

If you've installed pip, try this command:

pip install pbr==0.11.0

Besides, keystone CLI is deprecated as is mentioned in this post. Use Openstack CLI and Openstack API instead.

edit flag offensive delete link more

Comments

that was the first version it had installed. i downgraded to 0.9.0 and that didnt help

mickey gravatar imagemickey ( 2015-10-15 03:28:43 -0500 )edit

thats so funny ... doesnt matter which version i upgrade ... it always wants a nother ERROR: openstackclient.shell Exception raised: (pbr 0.11.0 (/usr/local/lib/python2.7/dist-packages), Requirement.parse('pbr>=1.6'))

mickey gravatar imagemickey ( 2015-10-15 03:34:42 -0500 )edit

What is your current version of keystone?

Cheng Liu gravatar imageCheng Liu ( 2015-10-15 03:50:44 -0500 )edit

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-10-15 03:15:43 -0500

Seen: 2,287 times

Last updated: Oct 15 '15