quantum client --version option, unexpected behaviour

Bug #974835 reported by Deepak Garg on 2012-04-06
This bug affects 1 person
Affects Status Importance Assigned to Milestone
yong sheng gong

Bug Description

deepak@deepak-app:/media/d/practice_code/py$ quantum --version=3
Unknown API version: 3
Usage: quantum [OPTIONS] <command> [args]

  -h, --help show this help message and exit
  -H HOST, --host=HOST ip address of api host
  -p PORT, --port=PORT api poort
  -s, --ssl use ssl
  -v, --verbose turn on verbose logging
  -f LOGFILE, --logfile=LOGFILE
                        log file path
  -t TOKEN, --token=TOKEN
                        authentication token
  --version=VERSION Accepts 1.1 and 1.0, defaults to env[QUANTUM_VERSION].

Traceback (most recent call last):
  File "/usr/local/bin/quantum", line 9, in <module>
    load_entry_point('python-quantumclient==2012.2', 'console_scripts', 'quantum')()
  File "/opt/stack/python-quantumclient/quantum/client/cli.py", line 267, in main
  File "/opt/stack/python-quantumclient/quantum/client/cli.py", line 136, in help
    cmds = commands[version]
KeyError: '3'

deepak@deepak-app:/media/d/practice_code/py$ quantum --version=3 list_nets
Unknown API version: 3
Traceback (most recent call last):
  File "/usr/local/bin/quantum", line 9, in <module>
    load_entry_point('python-quantumclient==2012.2', 'console_scripts', 'quantum')()
  File "/opt/stack/python-quantumclient/quantum/client/cli.py", line 271, in main
    if cmd not in commands[version].keys():
KeyError: '3'

Deepak Garg (deepak.garg) wrote :

We should exit the cli after this part of the code:

line 260:

    version = options.version
    if not version in commands:
        LOG.error("Unknown API version specified:%s", version)
        print "Unknown API version: %s" % version

currently it simply goes ahead

Changed in quantum:
assignee: nobody → yong sheng gong (gongysh)
status: New → Confirmed

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

Changed in quantum:
status: Confirmed → In Progress

Reviewed: https://review.openstack.org/7737
Committed: http://github.com/openstack/python-quantumclient/commit/f5035b341009505bf4f24c52a3aae548a6b238ea
Submitter: Jenkins
Branch: master

commit f5035b341009505bf4f24c52a3aae548a6b238ea
Author: Yong Sheng Gong <email address hidden>
Date: Thu May 24 14:59:32 2012 +0800

    quit and print usage when unsupported version specified.

    bug 974835

    Change-Id: Iddbf72281be0d4dd819b6f51cc7950d90af0dbbc

Changed in quantum:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2012-07-04
Changed in quantum:
milestone: none → folsom-2
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2012-09-27
Changed in quantum:
milestone: folsom-2 → 2012.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers