Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.

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: alifshit, awaugama, berrange, dansmith, eglynn, kchamart, mpryc, ratailor, rbryant, sbauza, sferdjao, sgordon, srevivo, vromanso
Target Milestone: ---Keywords: Triaged, ZStream
Target Release: 9.0 (Mitaka)   
Hardware: Unspecified   
OS: Unspecified   
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:
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/ +246
$nova --version

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

How reproducible:

Steps to Reproduce:

Actual results:
[stack@instack ~]$ nova --bypass-url  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 list
  ERROR (KeyError): 'versions'

$ nova --bypass-url list
  ERROR (KeyError): 'versions'

$ nova --bypass-url \ 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.