ia64/xen-unstable

changeset 7978:c1c8da6f2afe

Merged.
author emellor@leeni.uk.xensource.com
date Mon Nov 21 19:08:44 2005 +0100 (2005-11-21)
parents f546d8697b0e b2364dc83d1f
children f612aec588e2 602aefe7bd48
files
line diff
     1.1 --- a/tools/python/xen/xm/create.py	Mon Nov 21 19:08:27 2005 +0100
     1.2 +++ b/tools/python/xen/xm/create.py	Mon Nov 21 19:08:44 2005 +0100
     1.3 @@ -909,7 +909,10 @@ def parseCommandLine(argv):
     1.4  
     1.5  
     1.6  def main(argv):
     1.7 -    (opts, config) = parseCommandLine(argv)
     1.8 +    try:
     1.9 +        (opts, config) = parseCommandLine(argv)
    1.10 +    except StandardError, ex:
    1.11 +        err(str(ex))
    1.12  
    1.13      if not opts:
    1.14          return
    1.15 @@ -924,8 +927,7 @@ def main(argv):
    1.16          dom0_min_mem = xroot.get_dom0_min_mem()
    1.17          if dom0_min_mem != 0:
    1.18              if balloon_out(dom0_min_mem, opts):
    1.19 -                print >>sys.stderr, "error: cannot allocate enough memory for domain"
    1.20 -                sys.exit(1)
    1.21 +                err("cannot allocate enough memory for domain")
    1.22  
    1.23          dom = make_domain(opts, config)
    1.24          if opts.vals.console_autoconnect:
     2.1 --- a/tools/python/xen/xm/help.py	Mon Nov 21 19:08:27 2005 +0100
     2.2 +++ b/tools/python/xen/xm/help.py	Mon Nov 21 19:08:44 2005 +0100
     2.3 @@ -87,7 +87,10 @@ class Var:
     2.4          """Execute the check and set the variable to the new value.
     2.5          """
     2.6          if not self.check: return
     2.7 -        env[self.name] = self.check(self.name, env.get(self.name))
     2.8 +        try: 
     2.9 +            env[self.name] = self.check(self.name, env.get(self.name))
    2.10 +        except StandardError, ex:
    2.11 +            raise sys.exc_type, self.name + " - " + str(ex)
    2.12  
    2.13      def doHelp(self, out):
    2.14          """Print help for the variable.
     3.1 --- a/tools/python/xen/xm/main.py	Mon Nov 21 19:08:27 2005 +0100
     3.2 +++ b/tools/python/xen/xm/main.py	Mon Nov 21 19:08:44 2005 +0100
     3.3 @@ -182,7 +182,7 @@ For more help on xm create, see the xmdo
     3.4  help = {
     3.5      "--long": longhelp,
     3.6      "console": console_help,
     3.7 -    "create": create_help,
     3.8 +# create is handled specially
     3.9      "destroy": destroy_help,
    3.10      "domid ": domid_help,
    3.11      "domname": domname_help,
    3.12 @@ -846,6 +846,9 @@ def deprecated(old,new):
    3.13      err('Option %s is the new replacement, see "xm help %s" for more info' % (new, new))
    3.14  
    3.15  def usage(cmd=None):
    3.16 +    if cmd = 'create'
    3.17 +        xm_subcommand("create", "--help")
    3.18 +        sys.exit(1)
    3.19      if help.has_key(cmd):
    3.20          print "   " + help[cmd]
    3.21      else: