Merge lp:~jshepher/glance/lp798749 into lp:~hudson-openstack/glance/trunk

Proposed by Justin Shepherd
Status: Merged
Approved by: Jay Pipes
Approved revision: 171
Merged at revision: 172
Proposed branch: lp:~jshepher/glance/lp798749
Merge into: lp:~hudson-openstack/glance/trunk
Diff against target: 41 lines (+13/-13)
1 file modified
bin/glance-upload (+13/-13)
To merge this branch: bzr merge lp:~jshepher/glance/lp798749
Reviewer Review Type Date Requested Status
Jay Pipes (community) Approve
Devin Carlen (community) Approve
Review via email: mp+69874@code.launchpad.net

Description of the change

Use of "%default" in help string does not work, have to use "%(default)s". Per the 4th example http://docs.python.org/dev/library/argparse.html#prog

To post a comment you must log in.
Revision history for this message
Devin Carlen (devcamcar) wrote :

lgtm

review: Approve
Revision history for this message
Jay Pipes (jaypipes) wrote :

thx Shep!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'bin/glance-upload'
2--- bin/glance-upload 2011-03-05 17:04:43 +0000
3+++ bin/glance-upload 2011-07-30 04:35:49 +0000
4@@ -73,25 +73,25 @@
5 parser.add_argument('filename', help='file to upload into Glance')
6 parser.add_argument('name', help='name of image')
7 parser.add_argument('--host', metavar='HOST', default='127.0.0.1',
8- help='Location of Glance Server (default: %default)')
9+ help='Location of Glance Server (default: %(default)s)')
10 parser.add_argument('--port', metavar='PORT', type=int, default=9292,
11- help='Port of Glance Server (default: %default)')
12+ help='Port of Glance Server (default: %(default)s)')
13 parser.add_argument('--type', metavar='TYPE', default='raw',
14- help='Type of Image [kernel, ramdisk, machine, raw] '
15- '(default: %default)')
16+ help='Type of Image [kernel, ramdisk, machine, raw] '
17+ '(default: %(default)s)')
18 parser.add_argument('--disk-format', metavar='DISK_FORMAT', default=None,
19- choices=DISK_FORMATS,
20- help='Disk format of Image [%s] '
21- '(default: %%default)' % ','.join(DISK_FORMATS))
22+ choices=DISK_FORMATS,
23+ help='Disk format of Image [%s] '
24+ '(default: %%(default)s)' % ','.join(DISK_FORMATS))
25 parser.add_argument('--container-format', metavar='CONTAINER_FORMAT',
26- default=None, choices=CONTAINER_FORMATS,
27- help='Disk format of Image [%s] '
28- '(default: %%default)' % ','.join(CONTAINER_FORMATS))
29+ default=None, choices=CONTAINER_FORMATS,
30+ help='Disk format of Image [%s] '
31+ '(default: %%(default)s)' % ','.join(CONTAINER_FORMATS))
32 parser.add_argument('--kernel', metavar='KERNEL',
33- help='ID of kernel associated with this machine image')
34+ help='ID of kernel associated with this machine image')
35 parser.add_argument('--ramdisk', metavar='RAMDISK',
36- help='ID of ramdisk associated with this machine '
37- 'image')
38+ help='ID of ramdisk associated with this machine '
39+ 'image')
40 args = parser.parse_args()
41 return args
42

Subscribers

People subscribed via source and target branches