Summary: Fix exception handling in security_group.py

Detail: Code was attempting to concatinate an exception to a string.
Updated to convert to text and concatinate that.

BUG-ID: CLOUDSTACK-1052
Bugfix-for: master
Reported-by: Noa Resare
Signed-off-by: John Kinsella <[email protected]> 1363218769 -0700


Project: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/repo
Commit: 
http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/commit/beb6170d
Tree: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/tree/beb6170d
Diff: http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/diff/beb6170d

Branch: refs/heads/4.1
Commit: beb6170d2a5994edc2524c74751e7cf44843e98b
Parents: 6928679
Author: John Kinsella <[email protected]>
Authored: Wed Mar 13 16:52:49 2013 -0700
Committer: Chip Childers <[email protected]>
Committed: Thu Mar 14 15:40:24 2013 -0400

----------------------------------------------------------------------
 scripts/vm/network/security_group.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-cloudstack/blob/beb6170d/scripts/vm/network/security_group.py
----------------------------------------------------------------------
diff --git a/scripts/vm/network/security_group.py 
b/scripts/vm/network/security_group.py
index ed4180a..50a1641 100755
--- a/scripts/vm/network/security_group.py
+++ b/scripts/vm/network/security_group.py
@@ -25,6 +25,8 @@ import os
 import xml.dom.minidom
 from optparse import OptionParser, OptionGroup, OptParseError, BadOptionError, 
OptionError, OptionConflictError, OptionValueError
 import re
+import traceback
+
 iptables = Command("iptables")
 bash = Command("/bin/bash")
 virsh = Command("virsh")
@@ -692,7 +694,8 @@ def add_network_rules(vm_name, vm_id, vm_ip, signature, 
seqno, vmMac, rules, vif
     
     return 'true'
   except:
-    logging.debug("Failed to network rule !: " + sys.exc_type)
+    exceptionText = traceback.format_exc()
+    logging.debug("Failed to network rule !: " + exceptionText)
 
 def getVifs(vmName):
     vifs = []

Reply via email to