[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-3.0.3-testing] [XM] Remove traceback printing from load/makepolicy.py.



# 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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.