error message of "1 is not a supported API version. Example values are 1 or 2." is not precise

Bug #1536130 reported by gs-opencos-zte
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Won't Fix
Undecided
Unassigned

Bug Description

when i add a new api cli command in glance, i get the error message:
"1" is not a supported API version. Example values are "1" or "2".
the reason is i import a wrong module in glanceclient/v1/client.py,
so the return error message is not correct.

it can be recurrent by modifing "from glanceclient.v1.images import ImageManager" to
"from glanceclient.v1.imagesxxx import ImageManager" in glanceclient/v1/client.py, then you
execute "glance image-list", you will found it.

affects: openstack-community → glance
Revision history for this message
Kairat Kushaev (kkushaev) wrote :

I think you need to refine the bug description because it is not clear what is reproducible case here.
Did you modify master glance or glanceclient code and receive some error?
Could you please also paste stack trace here?

Revision history for this message
Kairat Kushaev (kkushaev) wrote :

I am marking this as Incomplete as need to answer some questions.
If you need some development help you can use #opestack-glance channel in irc.

Changed in glance:
status: New → Incomplete
Revision history for this message
gs-opencos-zte (gs-opencos-zte) wrote :

I have added new files disk_array.py both in master glance and glanceclient which copy from images.py,and modify them to my
 interface. Then i forgot to modify "from daisyclient.v1.images import DiskArrayManager" to "from daisyclient.v1.disk_array import DiskArrayManager" in glanceclient/v1/client.py. So i get the error message.

No stack trace raised, I added a breakpoint when bug happened:
[root@OpenstackServer ~]# python -m pdb /usr/bin/glance service-disk-list
> /usr/bin/glance(4)<module>()
-> import sys
(Pdb) c
> /usr/lib/python2.7/site-packages/glanceclient/shell.py(303)get_subcommand_parser()
-> submodule = utils.import_versioned_module(version, 'shell')
(Pdb) l
298
299 self.subcommands = {}
300 subparsers = parser.add_subparsers(metavar='<subcommand>')
301 try:
302 import pdb;pdb.set_trace()
303 -> submodule = utils.import_versioned_module(version, 'shell')
304 except ImportError:
305 print('"%s" is not a supported API version. Example '
306 'values are "1" or "2".' % version)
307 utils.exit()
308
(Pdb) c
"1" is not a supported API version. Example values are "1" or "2".
The program exited via sys.exit(). Exit status: 1
> /usr/bin/glance(4)<module>()
-> import sys
(Pdb) c
> /usr/lib/python2.7/site-packages/glanceclient/shell.py(303)get_subcommand_parser()
-> submodule = utils.import_versioned_module(version, 'shell')
(Pdb) c
"1" is not a supported API version. Example values are "1" or "2".
The program exited via sys.exit(). Exit status: 1
> /usr/bin/glance(4)<module>()
-> import sys

Revision history for this message
Abhishek Kekane (abhishek-kekane) wrote :

No more inputs on this bug, marking this as won't fix. Please feel free to reopen.

Changed in glance:
status: Incomplete → Won't Fix
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.