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
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(): ArgumentParser( description= 'Upload an image into Glance') ArgumentParser( description= 'Upload an image into Glance', add_help=False) add_argument( 'filename' , help='file to upload into Glance') add_argument( 'name', help='name of image') add_argument( '--host' , metavar='HOST', default= '127.0. 0.1',
- parser = argparse.
+ parser = argparse.
parser.
parser.
parser.
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.