glance cli programs fail with an exception when given the --version option.

Bug #1092631 reported by John Bresnahan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
John Bresnahan

Bug Description

The --help output from glance CLI programs list --version as an option. However, when the commands are give that option an exception is thrown and a stack trace is printed:

$ glance-manage --version
Traceback (most recent call last):
  File "/home/jbresnah/Dev/OpenStack/TMPVE/bin/glance-manage", line 5, in <module>
    pkg_resources.run_script('glance==2013.1', 'glance-manage')
  File "/home/jbresnah/Dev/OpenStack/TMPVE/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 489, in run_script
  File "/home/jbresnah/Dev/OpenStack/TMPVE/lib/python2.7/site-packages/setuptools-0.6c11-py2.7.egg/pkg_resources.py", line 1207, in run_script
  File "/home/jbresnah/Dev/OpenStack/TMPVE/lib/python2.7/site-packages/glance-2013.1-py2.7.egg/EGG-INFO/scripts/glance-manage", line 126, in <module>
    main()
  File "/home/jbresnah/Dev/OpenStack/TMPVE/lib/python2.7/site-packages/glance-2013.1-py2.7.egg/EGG-INFO/scripts/glance-manage", line 113, in main
    usage="%prog [options] <cmd>")
  File "/home/jbresnah/Dev/OpenStack/TMPVE/lib/python2.7/site-packages/glance-2013.1-py2.7.egg/glance/common/config.py", line 73, in parse_args
    default_config_files=default_config_files)
  File "/home/jbresnah/Dev/OpenStack/TMPVE/lib/python2.7/site-packages/glance-2013.1-py2.7.egg/glance/openstack/common/cfg.py", line 1024, in __call__
    self._cli_values, leftovers = self._parse_cli_opts(args)
  File "/home/jbresnah/Dev/OpenStack/TMPVE/lib/python2.7/site-packages/glance-2013.1-py2.7.egg/glance/openstack/common/cfg.py", line 1529, in _parse_cli_opts
    values, leftovers = self._oparser.parse_args(args)
  File "/usr/lib64/python2.7/optparse.py", line 1399, in parse_args
    stop = self._process_args(largs, rargs, values)
  File "/usr/lib64/python2.7/optparse.py", line 1439, in _process_args
    self._process_long_opt(rargs, values)
  File "/usr/lib64/python2.7/optparse.py", line 1514, in _process_long_opt
    option.process(opt, value, values, self)
  File "/usr/lib64/python2.7/optparse.py", line 788, in process
    self.action, self.dest, opt, value, values, parser)
  File "/usr/lib64/python2.7/optparse.py", line 813, in take_action
    parser.print_version()
  File "/usr/lib64/python2.7/optparse.py", line 1619, in print_version
    print >>file, self.get_version()
  File "/usr/lib64/python2.7/optparse.py", line 1606, in get_version
    return self.expand_prog_name(self.version)
  File "/usr/lib64/python2.7/optparse.py", line 1565, in expand_prog_name
    return s.replace("%prog", self.get_prog_name())
AttributeError: '_deferred_version_string' object has no attribute 'replace'

Changed in glance:
assignee: nobody → John Bresnahan (jbresnah)
status: New → In Progress
Changed in glance:
importance: Undecided → Low
Revision history for this message
John Bresnahan (jbresnah) wrote :

This has been fixed in a separate effort.

Changed in glance:
status: In Progress → Fix Released
status: Fix Released → Fix Committed
Revision history for this message
John Bresnahan (jbresnah) wrote :

This exception no longer happens in the master branch

Revision history for this message
Thierry Carrez (ttx) wrote :

Certainly released in grizzly-2

Changed in glance:
status: Fix Committed → Fix Released
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.