glance-upload --help fails

Bug #798749 reported by Graham Hemingway
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Glance
Fix Released
Low
Justin Shepherd

Bug Description

Using the Diablo milestone 1 release, if I run glance-upload --help it dies and puts out the following trace:

root@cloudfront1:~/images# glance-upload --help
Traceback (most recent call last):
  File "/usr/bin/glance-upload", line 132, in <module>
    main()
  File "/usr/bin/glance-upload", line 100, in main
    args = parse_args()
  File "/usr/bin/glance-upload", line 95, in parse_args
    args = parser.parse_args()
  File "/usr/lib/pymodules/python2.6/argparse.py", line 1698, in parse_args
    args, argv = self.parse_known_args(args, namespace)
  File "/usr/lib/pymodules/python2.6/argparse.py", line 1730, in parse_known_args
    return self._parse_known_args(args, namespace)
  File "/usr/lib/pymodules/python2.6/argparse.py", line 1932, in _parse_known_args
    start_index = consume_optional(start_index)
  File "/usr/lib/pymodules/python2.6/argparse.py", line 1872, in consume_optional
    take_action(action, args, option_string)
  File "/usr/lib/pymodules/python2.6/argparse.py", line 1800, in take_action
    action(self, namespace, argument_values, option_string)
  File "/usr/lib/pymodules/python2.6/argparse.py", line 1023, in __call__
    parser.print_help()
  File "/usr/lib/pymodules/python2.6/argparse.py", line 2319, in print_help
    self._print_message(self.format_help(), file)
  File "/usr/lib/pymodules/python2.6/argparse.py", line 2293, in format_help
    return formatter.format_help()
  File "/usr/lib/pymodules/python2.6/argparse.py", line 314, in format_help
    help = self._root_section.format_help()
  File "/usr/lib/pymodules/python2.6/argparse.py", line 244, in format_help
    func(*args)
  File "/usr/lib/pymodules/python2.6/argparse.py", line 244, in format_help
    func(*args)
  File "/usr/lib/pymodules/python2.6/argparse.py", line 544, in _format_action
    help_text = self._expand_help(action)
  File "/usr/lib/pymodules/python2.6/argparse.py", line 630, in _expand_help
    return self._get_help_string(action) % params
TypeError: %d format: a number is required, not dict

A detailed help dialog would be great.
Cheers,
   Graham

Related branches

Jay Pipes (jaypipes)
Changed in glance:
assignee: nobody → Rick Harris (rconradharris)
importance: Undecided → Low
milestone: none → diablo-2
Revision history for this message
Justin Shepherd (jshepher) wrote :

You can do the following, which will bypass the issue:

=== modified file 'bin/glance-upload'
--- bin/glance-upload 2011-03-05 17:04:43 +0000
+++ bin/glance-upload 2011-06-23 16:49:57 +0000
@@ -69,7 +69,7 @@

 def parse_args():
- parser = argparse.ArgumentParser(description='Upload an image into Glance')
+ parser = argparse.ArgumentParser(description='Upload an image into Glance', add_help=False)
     parser.add_argument('filename', help='file to upload into Glance')
     parser.add_argument('name', help='name of image')
     parser.add_argument('--host', metavar='HOST', default='127.0.0.1',

This also makes "-h" and "--help" unknown options (which still shows the help section anyway)

However, I have no idea why the help function is expecting a number not a dictionary.

Jay Pipes (jaypipes)
Changed in glance:
status: New → Triaged
milestone: diablo-2 → diablo-3
Jay Pipes (jaypipes)
Changed in glance:
milestone: diablo-3 → diablo-4
Changed in glance:
status: Triaged → In Progress
assignee: Rick Harris (rconradharris) → Justin Shepherd (jshepher)
Changed in glance:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in glance:
milestone: diablo-4 → 2011.3
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.