ia64/xen-unstable
changeset 2756:9b1dacc90715
bitkeeper revision 1.1159.1.293 (4180123d6fy9CmhZFhA2dxg-C2tnig)
create.py:
Set the name of the vm to the config file's basename if no name is
specified in the config file or on the commandline.
opts.py:
Handle trailing getopt arguments correctly.
create.py:
Set the name of the vm to the config file's basename if no name is
specified in the config file or on the commandline.
opts.py:
Handle trailing getopt arguments correctly.
author | cl349@freefall.cl.cam.ac.uk |
---|---|
date | Wed Oct 27 21:25:17 2004 +0000 (2004-10-27) |
parents | b112cdeb83fa |
children | 11a5fe965981 |
files | tools/python/xen/xm/create.py tools/python/xen/xm/opts.py |
line diff
1.1 --- a/tools/python/xen/xm/create.py Wed Oct 27 20:48:09 2004 +0000 1.2 +++ b/tools/python/xen/xm/create.py Wed Oct 27 21:25:17 2004 +0000 1.3 @@ -465,6 +465,8 @@ def main(argv): 1.4 else: 1.5 opts.load_defconfig() 1.6 preprocess(opts, opts.vals) 1.7 + if not opts.getopt('name') and opts.getopt('defconfig'): 1.8 + opts.setopt('name', os.path.basename(opts.getopt('defconfig'))) 1.9 config = make_config(opts.vals) 1.10 if opts.vals.dryrun: 1.11 PrettyPrint.prettyprint(config)
2.1 --- a/tools/python/xen/xm/opts.py Wed Oct 27 20:48:09 2004 +0000 2.2 +++ b/tools/python/xen/xm/opts.py Wed Oct 27 21:25:17 2004 +0000 2.3 @@ -313,6 +313,9 @@ class Opts: 2.4 print >>sys.stderr, "Error: Unknown option:", k 2.5 self.usage() 2.6 2.7 + if not args: 2.8 + break 2.9 + 2.10 # then process the 1st arg 2.11 (arg,args) = (args[0], args[1:]) 2.12