diff --git a/tools/python/xen/util/bugtool.py b/tools/python/xen/util/bugtool.py index 18569dcb33..e8d96b884a 100644 --- a/tools/python/xen/util/bugtool.py +++ b/tools/python/xen/util/bugtool.py @@ -141,7 +141,7 @@ def getBugTitle(bug): finally: f.close() - raise "Could not find title of bug %d!" % bug + raise ValueError("Could not find title of bug %d!" % bug) def send(bug, conn, fd, filename, username, password): diff --git a/tools/python/xen/xend/XendBase.py b/tools/python/xen/xend/XendBase.py index 73fed471dc..924477669a 100644 --- a/tools/python/xen/xend/XendBase.py +++ b/tools/python/xen/xend/XendBase.py @@ -115,7 +115,7 @@ class XendBase: # In OSS, ref == uuid return uuid else: - raise "Big Error.. TODO!" + raise ValueError("Big Error.. TODO!") def get_all_records(cls): return dict([(inst.get_uuid(), inst.get_record()) diff --git a/tools/python/xen/xm/main.py b/tools/python/xen/xm/main.py index e0e3d154b2..d7fd81be91 100644 --- a/tools/python/xen/xm/main.py +++ b/tools/python/xen/xm/main.py @@ -2796,7 +2796,7 @@ def xm_network_attach(args): for ref, record in server.xenapi.network .get_all_records().items()]) if bridge not in networks.keys(): - raise "Unknown bridge name!" + raise ValueError("Unknown bridge name!") return networks[bridge] vif_conv = { diff --git a/tools/python/xen/xm/xenapi_create.py b/tools/python/xen/xm/xenapi_create.py index ca8adc0a10..efe96ebd82 100644 --- a/tools/python/xen/xm/xenapi_create.py +++ b/tools/python/xen/xm/xenapi_create.py @@ -707,7 +707,7 @@ class sxp2xml: vm.attributes['security_label'] = \ security.set_security_label(sec_data[0][1][1],sec_data[0][2][1]) except Exception, e: - raise "Invalid security data format: %s" % str(sec_data) + raise ValueError("Invalid security data format: %s" % str(sec_data)) # Make the name tag