Bug 1517264

Summary: nova --bypass-url flag throw the ERROR (KeyError): 'versions'
Product: Red Hat OpenStack Reporter: Md Nadeem <mnadeem>
Component: openstack-novaAssignee: Rajesh Tailor <ratailor>
Status: CLOSED WONTFIX QA Contact: Joe H. Rahme <jhakimra>
Severity: medium Docs Contact:
Priority: low    
Version: 9.0 (Mitaka)CC: awaugama, berrange, dasmith, eglynn, kchamart, mpryc, ratailor, sbauza, sferdjao, sgordon, srevivo, vromanso
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: 9.0 (Mitaka)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1525427 (view as bug list) Environment:
Last Closed: 2018-01-29 20:54:45 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1525427    

Description Md Nadeem 2017-11-24 12:40:00 UTC
Description of problem:

While executing the any nova command with --bypass-url, it throw the error ERROR (KeyError): 'versions'. After analyzing a bit, i come to know the below parameter set wrong. 

response_key get sets to "versions" where as it gets set to "servers" when execute without --bypass-url and produce the expected output.

>> /usr/lib/python2.7/site-packages/novaclient/base.py +246
    
$nova --version
3.3.2

 
Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:
[stack@instack ~]$ nova --bypass-url http://192.168.124.20:8774/v2.1/  list

ERROR (KeyError): 'versions'


Expected results:
It should produce the expected output of nova list

Additional info:

Comment 4 Artom Lifshitz 2018-01-29 20:54:45 UTC
I believe the traceback is an indication that the URL given to --bypass-url is wrong. I agree that the traceback is completely unhelpful, but the root cause is the missing tenant ID (which can be obtained with `openstack token issue` and looking at the project_id field) in --bypass-url. Here's a quick test I did in a packstack-deployed OSP9 allinone:

$ openstack token issue | grep project_id
  project_id | ee46bec1fc7d4382b0397d9e0671e92b |


$ nova --bypass-url http://192.168.100.141:8774/v2.1/ list
  ERROR (KeyError): 'versions'

$ nova --bypass-url http://192.168.100.141:8774/this/is/wrong list
  ERROR (KeyError): 'versions'

$ nova --bypass-url \ 
  http://192.168.100.141:8774/v2.1/ee46bec1fc7d4382b0397d9e0671e92b/ list

  +----+------+--------+------------+-------------+----------+
  | ID | Name | Status | Task State | Power State | Networks |
  +----+------+--------+------------+-------------+----------+
  +----+------+--------+------------+-------------+----------+

Because it's fairly easy to correct this without any changes to the code, and the fact that OSP9 (mitaka) is EOL upstream, I'd like to close this bug. If adding the tenant ID doesn't fix the problem, please re-open the bug.