flavor list not working in osc-lib.py example fails (havana cluster)

Bug #1463535 reported by Loic Dachary on 2015-06-09
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-openstackclient
Invalid
Low
Unassigned

Bug Description

Using a havana openstack cluster openstack flavor list works but the osc-lib.py example fails with

   AuthorizationFailure: Authentication requires 'auth_url', which should be specified in 'HTTPClient'

Steps to reproduce:

* virtualenv virtualenv
* . virtualenv/bin/activate
* pip install python-openstackclient
* wget -O /tmp/common.py 'https://git.openstack.org/cgit/openstack/python-openstackclient/plain/examples/common.py?id=e8655f44f07db36d05043ef8e15796e75ec380ba'
* wget -O /tmp/osc-lib.py 'https://git.openstack.org/cgit/openstack/python-openstackclient/plain/examples/osc-lib.py?id=e8655f44f07db36d05043ef8e15796e75ec380ba'
* comment out the part that list the objectstore, only keep the flavors in osc-lib.py
* . openstack.sh # to get credentials
* openstack --version # shows 1.3.0
* openstack flavor list # works as expected
* python /tmp/osc-lib.py --debug # fails as follows

DEBUG: root defaults: {'auth_type': 'password', 'compute_api_version': '2', 'database_api_version': '1.0', 'api_timeout': None, 'baremetal_api_version': '1', 'image_api_use_tasks': False, 'en\
dpoint_type': 'public', 'floating_ip_source': 'neutron', 'key': None, 'cacert': None, 'network_api_version': '2', 'object_api_version': '1', 'image_api_version': '1', 'verify': True, 'identit\
y_api_version': '2', 'volume_api_version': '1', 'cert': None, 'secgroup_source': 'neutron', 'disable_vendor_agent': {}}
DEBUG: stevedore.extension found extension EntryPoint.parse('osc_password = openstackclient.api.auth_plugin:OSCGenericPassword')
DEBUG: stevedore.extension found extension EntryPoint.parse('token_endpoint = openstackclient.api.auth_plugin:TokenEndpoint')
DEBUG: stevedore.extension found extension EntryPoint.parse('v2token = keystoneclient.auth.identity.v2:Token')
DEBUG: stevedore.extension found extension EntryPoint.parse('v2password = keystoneclient.auth.identity.v2:Password')
DEBUG: stevedore.extension found extension EntryPoint.parse('v3password = keystoneclient.auth.identity.v3:Password')
DEBUG: stevedore.extension found extension EntryPoint.parse('v3scopedsaml = keystoneclient.contrib.auth.v3.saml2:Saml2ScopedToken')
DEBUG: stevedore.extension found extension EntryPoint.parse('v3unscopedadfs = keystoneclient.contrib.auth.v3.saml2:ADFSUnscopedToken')
DEBUG: stevedore.extension found extension EntryPoint.parse('token = keystoneclient.auth.identity.generic:Token')
DEBUG: stevedore.extension found extension EntryPoint.parse('v3token = keystoneclient.auth.identity.v3:Token')
DEBUG: stevedore.extension found extension EntryPoint.parse('password = keystoneclient.auth.identity.generic:Password')
DEBUG: stevedore.extension found extension EntryPoint.parse('v3unscopedsaml = keystoneclient.contrib.auth.v3.saml2:Saml2UnscopedToken')
DEBUG: root cloud cfg: {'auth_type': 'password', 'compute_api_version': '2', 'database_api_version': '1.0', 'rest': [], 'timing': False, 'network_api_version': '2', 'object_api_version': '1',\
 'image_api_version': '1', 'verify': False, 'verbose_level': 1, 'region_name': '', 'insecure': False, 'api_timeout': None, 'baremetal_api_version': '1', 'auth': {'username': 'teuthology', 'pr\
oject_id': 'a5fa44393fbf4a1fa006d83b996595ef', 'project_name': 'teuthology', 'password': 'nadWWaHac3', 'auth_url': 'http://188.165.23.81:5000/v2.0'}, 'default_domain': 'default', 'image_ap\
i_use_tasks': False, 'endpoint_type': 'public', 'floating_ip_source': 'neutron', 'key': None, 'cacert': None, 'identity_api_version': '2', 'volume_api_version': '1', 'cert': None, 'secgroup_s\
ource': 'neutron', 'debug': True, 'disable_vendor_agent': {}}
AAAA {'compute': '2', 'network': '2', 'image': '1', 'volume': '1', 'identity': '2', 'object_store': '1'}
DEBUG: openstackclient.compute.client Instantiating compute client: <class 'novaclient.v2.client.Client'>
ERROR: common Traceback (most recent call last):
  File "/tmp/common.py", line 261, in main
    return run(opts)
  File "/tmp/osc-lib.py", line 102, in run
    flavor_list = client_manager.compute.servers.list()
  File "/home/ubuntu/virtualenv/local/lib/python2.7/site-packages/novaclient/v2/servers.py", line 600, in list
    return self._list("/servers%s%s" % (detail, query_string), "servers")
  File "/home/ubuntu/virtualenv/local/lib/python2.7/site-packages/novaclient/base.py", line 64, in _list
    _resp, body = self.api.client.get(url)
  File "/home/ubuntu/virtualenv/local/lib/python2.7/site-packages/novaclient/client.py", line 451, in get
    return self._cs_request(url, 'GET', **kwargs)
  File "/home/ubuntu/virtualenv/local/lib/python2.7/site-packages/novaclient/client.py", line 407, in _cs_request
    self.authenticate()
  File "/home/ubuntu/virtualenv/local/lib/python2.7/site-packages/novaclient/client.py", line 534, in authenticate
    raise exceptions.AuthorizationFailure(msg)
AuthorizationFailure: Authentication requires 'auth_url', which should be specified in 'HTTPClient'

(virtualenv)ubuntu@teuthology:~$ openstack --version
openstack 1.3.0

Terry Howe (thowe-g) wrote :

Does it still fail if you 'pip install --upgrade python-novaclient'?

Loic Dachary (dachary) wrote :

python-novaclient is the latest already:

(virtualenv)ubuntu@teuthology:~$ pip list installed | grep python-novaclient
python-novaclient (2.26.0)
(virtualenv)ubuntu@teuthology:~$ pip install --upgrade python-novaclient
Requirement already up-to-date: python-novaclient in ./virtualenv/lib/python2.7/site-packages
Cleaning up...

Loic Dachary (dachary) wrote :

Adding the line

       client_manager.auth_ref

after client_manager = clientmanager.ClientManager(... in osc-lib.py fixes the issue.

Fix proposed to branch: master
Review: https://review.openstack.org/190075

Changed in python-openstackclient:
status: New → In Progress
summary: - penstack flavor list works but the osc-lib.py example fails (havana
- cluster)
+ flavor list works in osc-lib.py example fails (havana cluster)

@stevemar it should be "flavor list in osc-lib.py example fails (havana cluster)"

summary: - flavor list works in osc-lib.py example fails (havana cluster)
+ flavor list not working in osc-lib.py example fails (havana cluster)
Changed in python-openstackclient:
importance: Undecided → Low

Change abandoned by Loic Dachary (<email address hidden>) on branch: master
Review: https://review.openstack.org/190075

Loic Dachary (dachary) on 2015-07-13
Changed in python-openstackclient:
status: In Progress → Confirmed
Steve Martinelli (stevemar) wrote :

given that icehouse isn't supported, should we fix this for havana?

Steve Martinelli (stevemar) wrote :

marking as invalid since havana and icehouse are not supported and juno is on life support

Changed in python-openstackclient:
status: Confirmed → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers