WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] Merged.

# HG changeset patch
# User emellor@xxxxxxxxxxxxxxxxxxxxxx
# Node ID c1c8da6f2afece83a6f8f6aaa02c95d80bba2761
# Parent  f546d8697b0e614d05e2505d10ffb2542c16f3b8
# Parent  b2364dc83d1f4eefe6b4b740d26f5505f9bbf00c
Merged.

diff -r f546d8697b0e -r c1c8da6f2afe tools/python/xen/xm/create.py
--- a/tools/python/xen/xm/create.py     Mon Nov 21 18:08:27 2005
+++ b/tools/python/xen/xm/create.py     Mon Nov 21 18:08:44 2005
@@ -909,7 +909,10 @@
 
 
 def main(argv):
-    (opts, config) = parseCommandLine(argv)
+    try:
+        (opts, config) = parseCommandLine(argv)
+    except StandardError, ex:
+        err(str(ex))
 
     if not opts:
         return
@@ -924,8 +927,7 @@
         dom0_min_mem = xroot.get_dom0_min_mem()
         if dom0_min_mem != 0:
             if balloon_out(dom0_min_mem, opts):
-                print >>sys.stderr, "error: cannot allocate enough memory for 
domain"
-                sys.exit(1)
+                err("cannot allocate enough memory for domain")
 
         dom = make_domain(opts, config)
         if opts.vals.console_autoconnect:
diff -r f546d8697b0e -r c1c8da6f2afe tools/python/xen/xm/help.py
--- a/tools/python/xen/xm/help.py       Mon Nov 21 18:08:27 2005
+++ b/tools/python/xen/xm/help.py       Mon Nov 21 18:08:44 2005
@@ -87,7 +87,10 @@
         """Execute the check and set the variable to the new value.
         """
         if not self.check: return
-        env[self.name] = self.check(self.name, env.get(self.name))
+        try: 
+            env[self.name] = self.check(self.name, env.get(self.name))
+        except StandardError, ex:
+            raise sys.exc_type, self.name + " - " + str(ex)
 
     def doHelp(self, out):
         """Print help for the variable.
diff -r f546d8697b0e -r c1c8da6f2afe tools/python/xen/xm/main.py
--- a/tools/python/xen/xm/main.py       Mon Nov 21 18:08:27 2005
+++ b/tools/python/xen/xm/main.py       Mon Nov 21 18:08:44 2005
@@ -182,7 +182,7 @@
 help = {
     "--long": longhelp,
     "console": console_help,
-    "create": create_help,
+# create is handled specially
     "destroy": destroy_help,
     "domid ": domid_help,
     "domname": domname_help,
@@ -846,6 +846,9 @@
     err('Option %s is the new replacement, see "xm help %s" for more info' % 
(new, new))
 
 def usage(cmd=None):
+    if cmd = 'create'
+        xm_subcommand("create", "--help")
+        sys.exit(1)
     if help.has_key(cmd):
         print "   " + help[cmd]
     else:

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>