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] [xen-3.0.3-testing] [XM] Remove traceback printing from

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-3.0.3-testing] [XM] Remove traceback printing from load/makepolicy.py.
From: "Xen patchbot-3.0.3-testing" <patchbot-3.0.3-testing@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 02 Oct 2006 12:40:22 -0700
Delivery-date: Tue, 03 Oct 2006 01:19:05 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User atse@xxxxxxxxxxxxxxxxxxxxxxxx
# Date 1159442992 -3600
# Node ID 98c369711006c73ef9ff2891052c5d3db8a235fd
# Parent  98ba161961b5334657e80f260e4c6be11ac3e90c
[XM] Remove traceback printing from load/makepolicy.py.

Should pass the exception along to xm/main.py to handle properly like
the rest of the commands.

Signed-off-by: Alastair Tse <atse@xxxxxxxxxxxxx>
---
 tools/python/xen/xm/loadpolicy.py |   17 +++++++----------
 tools/python/xen/xm/makepolicy.py |   15 ++++++---------
 2 files changed, 13 insertions(+), 19 deletions(-)

diff -r 98ba161961b5 -r 98c369711006 tools/python/xen/xm/loadpolicy.py
--- a/tools/python/xen/xm/loadpolicy.py Thu Sep 28 12:23:21 2006 +0100
+++ b/tools/python/xen/xm/loadpolicy.py Thu Sep 28 12:29:52 2006 +0100
@@ -31,15 +31,12 @@ def main(argv):
     if len(argv) != 2:
         raise OptionError('No policy defined')
     
-    try:
-        load_policy(argv[1])
-
-    except ACMError:
-        sys.exit(-1)
-    except:
-        traceback.print_exc(limit = 1)
+    load_policy(argv[1])
 
 if __name__ == '__main__':
-    main(sys.argv)
-
-
+    try:
+        main(sys.argv)
+    except Exception, e:
+        sys.stderr.write('Error: %s\n' % str(e))
+        sys.exit(-1)
+        
diff -r 98ba161961b5 -r 98c369711006 tools/python/xen/xm/makepolicy.py
--- a/tools/python/xen/xm/makepolicy.py Thu Sep 28 12:23:21 2006 +0100
+++ b/tools/python/xen/xm/makepolicy.py Thu Sep 28 12:29:52 2006 +0100
@@ -33,16 +33,13 @@ def main(argv):
     if len(argv) != 2:
         raise OptionError('No XML policy file specified')
 
+    make_policy(argv[1])
+
+if __name__ == '__main__':
     try:
-        make_policy(argv[1])
-    except ACMError:
-        sys.exit(-1)
-    except:
-        traceback.print_exc(limit=1)
+        main(sys.argv)
+    except Exception, e:
+        sys.stderr.write('Error: %s\n' % str(e))
         sys.exit(-1)
 
 
-if __name__ == '__main__':
-    main(sys.argv)
-
-

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-3.0.3-testing] [XM] Remove traceback printing from load/makepolicy.py., Xen patchbot-3.0.3-testing <=