Blame SOURCES/0017-raise-is-a-function-call-in-python3.patch

1070a0
From 650f96a40ab858904ae4ea17481a59a75ade7def Mon Sep 17 00:00:00 2001
1070a0
From: Tomas Kasparek <tkasparek@redhat.com>
1070a0
Date: Mon, 5 Mar 2018 12:02:02 +0100
1070a0
Subject: [PATCH 17/17] raise is a function call in python3
1070a0
1070a0
---
1070a0
 koan/app.py         | 82 ++++++++++++++++++++++++++---------------------------
1070a0
 koan/qcreate.py     |  2 +-
1070a0
 koan/register.py    |  8 +++---
1070a0
 koan/utils.py       | 42 +++++++++++++--------------
1070a0
 koan/virtinstall.py | 14 ++++-----
1070a0
 koan/vmwcreate.py   | 10 +++----
1070a0
 6 files changed, 79 insertions(+), 79 deletions(-)
1070a0
1070a0
diff --git a/koan/app.py b/koan/app.py
1070a0
index f5af5e9..ed81fe4 100755
1070a0
--- a/koan/app.py
1070a0
+++ b/koan/app.py
1070a0
@@ -283,7 +283,7 @@ class Koan:
1070a0
         # we can get the info we need from either the cobbler server
1070a0
         #  or a kickstart file
1070a0
         if self.server is None:
1070a0
-            raise InfoException("no server specified")
1070a0
+            raise(InfoException("no server specified"))
1070a0
 
1070a0
         # check to see that exclusive arguments weren't used together
1070a0
         found = 0
1070a0
@@ -291,13 +291,13 @@ class Koan:
1070a0
             if x:
1070a0
                found = found+1
1070a0
         if found != 1:
1070a0
-            raise InfoException("choose: --virt, --replace-self, --update-files, --list=what, or --display")
1070a0
+            raise(InfoException("choose: --virt, --replace-self, --update-files, --list=what, or --display"))
1070a0
  
1070a0
 
1070a0
         # This set of options are only valid with --server
1070a0
         if not self.server or self.server == "":
1070a0
             if self.list_items or self.profile or self.system or self.port:
1070a0
-                raise InfoException("--server is required")
1070a0
+                raise(InfoException("--server is required"))
1070a0
 
1070a0
         self.xmlrpc_server = utils.connect_to_server(server=self.server, port=self.port)
1070a0
 
1070a0
@@ -315,7 +315,7 @@ class Koan:
1070a0
         # if both --profile and --system were ommitted, autodiscover
1070a0
         if self.is_virt:
1070a0
             if (self.profile is None and self.system is None and self.image is None):
1070a0
-                raise InfoException("must specify --profile, --system, or --image")
1070a0
+                raise(InfoException("must specify --profile, --system, or --image"))
1070a0
         else:
1070a0
             if (self.profile is None and self.system is None and self.image is None):
1070a0
                 self.system = self.autodetect_system(allow_interactive=self.live_cd)
1070a0
@@ -330,23 +330,23 @@ class Koan:
1070a0
             if self.virt_type not in [ "qemu", "xenpv", "xenfv", "xen", "vmware", "vmwarew", "auto" ]:
1070a0
                if self.virt_type == "xen":
1070a0
                    self.virt_type = "xenpv"
1070a0
-               raise InfoException("--virt-type should be qemu, xenpv, xenfv, vmware, vmwarew, or auto")
1070a0
+               raise(InfoException("--virt-type should be qemu, xenpv, xenfv, vmware, vmwarew, or auto"))
1070a0
 
1070a0
         # if --qemu-disk-type was called without --virt-type=qemu, then fail
1070a0
         if (self.qemu_disk_type is not None):
1070a0
             self.qemu_disk_type = self.qemu_disk_type.lower()
1070a0
             if self.virt_type not in [ "qemu", "auto", "kvm" ]:
1070a0
-               raise(InfoException, "--qemu-disk-type must use with --virt-type=qemu")
1070a0
+               raise((InfoException, "--qemu-disk-type must use with --virt-type=qemu"))
1070a0
 
1070a0
         # if --qemu-net-type was called without --virt-type=qemu, then fail
1070a0
         if (self.qemu_net_type is not None):
1070a0
             self.qemu_net_type = self.qemu_net_type.lower()
1070a0
             if self.virt_type not in [ "qemu", "auto", "kvm" ]:
1070a0
-               raise InfoException, "--qemu-net-type must use with --virt-type=qemu"
1070a0
+               raise(InfoException, "--qemu-net-type must use with --virt-type=qemu")
1070a0
 
1070a0
         # if --static-interface and --profile was called together, then fail
1070a0
         if self.static_interface is not None and self.profile is not None:
1070a0
-            raise InfoException("--static-interface option is incompatible with --profile option use --system instead")
1070a0
+            raise(InfoException("--static-interface option is incompatible with --profile option use --system instead"))
1070a0
 
1070a0
         # perform one of three key operations
1070a0
         if self.is_virt:
1070a0
@@ -423,12 +423,12 @@ class Koan:
1070a0
         detected_systems = utils.uniqify(detected_systems)
1070a0
 
1070a0
         if len(detected_systems) > 1:
1070a0
-            raise InfoException("Error: Multiple systems matched")
1070a0
+            raise(InfoException("Error: Multiple systems matched"))
1070a0
         elif len(detected_systems) == 0:
1070a0
             if not allow_interactive:
1070a0
                 mac_criteria = utils.uniqify(mac_criteria, purge="?")
1070a0
                 ip_criteria  = utils.uniqify(ip_criteria, purge="?")
1070a0
-                raise InfoException("Error: Could not find a matching system with MACs: %s or IPs: %s" % (",".join(mac_criteria), ",".join(ip_criteria)))
1070a0
+                raise(InfoException("Error: Could not find a matching system with MACs: %s or IPs: %s" % (",".join(mac_criteria), ",".join(ip_criteria))))
1070a0
             else:
1070a0
                 return None
1070a0
         elif len(detected_systems) == 1:
1070a0
@@ -506,7 +506,7 @@ class Koan:
1070a0
             if self.virt_type == "auto":
1070a0
 
1070a0
                 if profile_data.get("xml_file","") != "":
1070a0
-                    raise InfoException("xmlfile based installations are not supported")
1070a0
+                    raise(InfoException("xmlfile based installations are not supported"))
1070a0
 
1070a0
                 elif "file" in profile_data:
1070a0
                     print("- ISO or Image based installation, always uses --virt-type=qemu")
1070a0
@@ -523,7 +523,7 @@ class Koan:
1070a0
                         self.virt_type = "qemu"
1070a0
                     else:
1070a0
                         # assume Xen, we'll check to see if virt-type is really usable later.
1070a0
-                        raise InfoException("Not running a Xen kernel and qemu is not installed")
1070a0
+                        raise(InfoException("Not running a Xen kernel and qemu is not installed"))
1070a0
 
1070a0
                 print("- no virt-type specified, auto-selecting %s" % self.virt_type)
1070a0
 
1070a0
@@ -535,20 +535,20 @@ class Koan:
1070a0
                 uname_str = cmd.communicate()[0]
1070a0
                 # correct kernel on dom0?
1070a0
                 if uname_str.find("xen") == -1:
1070a0
-                   raise InfoException("kernel-xen needs to be in use")
1070a0
+                   raise(InfoException("kernel-xen needs to be in use"))
1070a0
                 # xend installed?
1070a0
                 if not os.path.exists("/usr/sbin/xend"):
1070a0
-                   raise InfoException("xen package needs to be installed")
1070a0
+                   raise(InfoException("xen package needs to be installed"))
1070a0
                 # xend running?
1070a0
                 rc = sub_process.call("/usr/sbin/xend status", stderr=None, stdout=None, shell=True)
1070a0
                 if rc != 0:
1070a0
-                   raise InfoException("xend needs to be started")
1070a0
+                   raise(InfoException("xend needs to be started"))
1070a0
 
1070a0
             # for qemu
1070a0
             if self.virt_type == "qemu":
1070a0
                 # qemu package installed?
1070a0
                 if not os.path.exists("/usr/bin/qemu-img"):
1070a0
-                    raise InfoException("qemu package needs to be installed")
1070a0
+                    raise(InfoException("qemu package needs to be installed"))
1070a0
                 # is libvirt new enough?
1070a0
                 # Note: in some newer distros (like Fedora 19) the python-virtinst package has been
1070a0
                 # subsumed into virt-install. If we don't have one check to see if we have the other.
1070a0
@@ -556,7 +556,7 @@ class Koan:
1070a0
                 if rc != 0:
1070a0
                     rc, version_str = utils.subprocess_get_response(shlex.split('rpm -q python-virtinst'), True)
1070a0
                     if rc != 0 or version_str.find("virtinst-0.1") != -1 or version_str.find("virtinst-0.0") != -1:
1070a0
-                        raise InfoException("need python-virtinst >= 0.2 or virt-install package to do installs for qemu/kvm (depending on your OS)")
1070a0
+                        raise(InfoException("need python-virtinst >= 0.2 or virt-install package to do installs for qemu/kvm (depending on your OS)"))
1070a0
 
1070a0
             # for vmware
1070a0
             if self.virt_type == "vmware" or self.virt_type == "vmwarew":
1070a0
@@ -565,14 +565,14 @@ class Koan:
1070a0
 
1070a0
             if self.virt_type == "virt-image":
1070a0
                 if not os.path.exists("/usr/bin/virt-image"):
1070a0
-                    raise InfoException("virt-image not present, downlevel virt-install package?")
1070a0
+                    raise(InfoException("virt-image not present, downlevel virt-install package?"))
1070a0
 
1070a0
             # for both virt types
1070a0
             if os.path.exists("/etc/rc.d/init.d/libvirtd"):
1070a0
                 rc = sub_process.call("/sbin/service libvirtd status", stdout=None, shell=True)
1070a0
                 if rc != 0:
1070a0
                     # libvirt running?
1070a0
-                    raise InfoException("libvirtd needs to be running")
1070a0
+                    raise(InfoException("libvirtd needs to be running"))
1070a0
 
1070a0
 
1070a0
             if self.virt_type in [ "xenpv" ]:
1070a0
@@ -642,7 +642,7 @@ class Koan:
1070a0
 
1070a0
     def list(self,what):
1070a0
         if what not in [ "images", "profiles", "systems", "distros", "repos" ]:
1070a0
-            raise InfoException("koan does not know how to list that")
1070a0
+            raise(InfoException("koan does not know how to list that"))
1070a0
         data = self.get_data(what)
1070a0
         for x in data:
1070a0
             if "name" in x:
1070a0
@@ -766,12 +766,12 @@ class Koan:
1070a0
             #   asm-x86_64/setup.h:#define COMMAND_LINE_SIZE    2048
1070a0
             if arch.startswith("ppc") or arch.startswith("ia64"):
1070a0
                 if len(k_args) > 511:
1070a0
-                    raise InfoException("Kernel options are too long, 512 chars exceeded: %s" % k_args)
1070a0
+                    raise(InfoException("Kernel options are too long, 512 chars exceeded: %s" % k_args))
1070a0
             elif arch.startswith("s390"):
1070a0
                 if len(k_args) > 895:
1070a0
-                    raise(InfoException, "Kernel options are too long, 896 chars exceeded: %s" % k_args)
1070a0
+                    raise((InfoException, "Kernel options are too long, 896 chars exceeded: %s" % k_args))
1070a0
             elif len(k_args) > 2047:
1070a0
-                raise(InfoException, "Kernel options are too long, 2047 chars exceeded: %s" % k_args)
1070a0
+                raise((InfoException, "Kernel options are too long, 2047 chars exceeded: %s" % k_args))
1070a0
 
1070a0
             utils.subprocess_call([
1070a0
                 'kexec',
1070a0
@@ -803,18 +803,18 @@ class Koan:
1070a0
         except OSError as xxx_todo_changeme:
1070a0
             (err, msg) = xxx_todo_changeme.args
1070a0
             if err != errno.ENOENT:
1070a0
-                raise
1070a0
+                raise()
1070a0
         try:
1070a0
             os.makedirs("/var/spool/koan")
1070a0
         except OSError as xxx_todo_changeme:
1070a0
             (err, msg) = xxx_todo_changeme.args
1070a0
             if err != errno.EEXIST:
1070a0
-                raise
1070a0
+                raise()
1070a0
     
1070a0
 
1070a0
         def after_download(self, profile_data):
1070a0
             if not os.path.exists("/sbin/grubby"):
1070a0
-                raise InfoException("grubby is not installed")
1070a0
+                raise(InfoException("grubby is not installed"))
1070a0
             k_args = self.calc_kernel_args(profile_data,replace_self=1)
1070a0
 
1070a0
             kickstart = self.safe_load(profile_data,'kickstart')
1070a0
@@ -846,12 +846,12 @@ class Koan:
1070a0
             #   asm-x86_64/setup.h:#define COMMAND_LINE_SIZE    2048
1070a0
             if arch.startswith("ppc") or arch.startswith("ia64"):
1070a0
                 if len(k_args) > 511:
1070a0
-                    raise InfoException("Kernel options are too long, 512 chars exceeded: %s" % k_args)
1070a0
+                    raise(InfoException("Kernel options are too long, 512 chars exceeded: %s" % k_args))
1070a0
             elif arch.startswith("s390"):
1070a0
                 if len(k_args) > 895:
1070a0
-                    raise(InfoException, "Kernel options are too long, 896 chars exceeded: %s" % k_args)
1070a0
+                    raise((InfoException, "Kernel options are too long, 896 chars exceeded: %s" % k_args))
1070a0
             elif len(k_args) > 2047:
1070a0
-                raise(InfoException, "Kernel options are too long, 2047 chars exceeded: %s" % k_args)
1070a0
+                raise((InfoException, "Kernel options are too long, 2047 chars exceeded: %s" % k_args))
1070a0
 
1070a0
             cmd = [ "/sbin/grubby",
1070a0
                     "--add-kernel", self.safe_load(profile_data,'kernel_local'),
1070a0
@@ -977,7 +977,7 @@ class Koan:
1070a0
     #---------------------------------------------------
1070a0
 
1070a0
     def connect_fail(self):
1070a0
-        raise InfoException("Could not communicate with %s:%s" % (self.server, self.port))
1070a0
+        raise(InfoException("Could not communicate with %s:%s" % (self.server, self.port)))
1070a0
 
1070a0
     #---------------------------------------------------
1070a0
 
1070a0
@@ -991,7 +991,7 @@ class Koan:
1070a0
             traceback.print_exc()
1070a0
             self.connect_fail()
1070a0
         if data == {}:
1070a0
-            raise InfoException("No entry/entries found")
1070a0
+            raise(InfoException("No entry/entries found"))
1070a0
         return data
1070a0
     
1070a0
     #---------------------------------------------------
1070a0
@@ -1060,7 +1060,7 @@ class Koan:
1070a0
             utils.urlgrab(kernel,kernel_save)
1070a0
         except:
1070a0
             traceback.print_exc()
1070a0
-            raise(InfoException, "error downloading files")
1070a0
+            raise((InfoException, "error downloading files"))
1070a0
         profile_data['kernel_local'] = kernel_save
1070a0
         profile_data['initrd_local'] = initrd_save
1070a0
 
1070a0
@@ -1179,7 +1179,7 @@ class Koan:
1070a0
             elif can_poll == "qemu":
1070a0
                conn = libvirt.open("qemu:///system")
1070a0
             else:
1070a0
-               raise InfoException("Don't know how to poll this virt-type")
1070a0
+               raise(InfoException("Don't know how to poll this virt-type"))
1070a0
             ct = 0
1070a0
             while True:
1070a0
                time.sleep(3)
1070a0
@@ -1196,7 +1196,7 @@ class Koan:
1070a0
                    utils.find_vm(conn, virtname).create()    
1070a0
                    return results
1070a0
                else:
1070a0
-                   raise InfoException("internal error, bad virt state")
1070a0
+                   raise(InfoException("internal error, bad virt state"))
1070a0
 
1070a0
         if virt_auto_boot:
1070a0
             if self.virt_type in [ "xenpv", "xenfv" ]:
1070a0
@@ -1240,7 +1240,7 @@ class Koan:
1070a0
             uuid = None
1070a0
             creator = vmwwcreate.start_install
1070a0
         else:
1070a0
-            raise InfoException("Unspecified virt type: %s" % self.virt_type)
1070a0
+            raise(InfoException("Unspecified virt type: %s" % self.virt_type))
1070a0
         return (uuid, creator, fullvirt, can_poll)
1070a0
 
1070a0
     #---------------------------------------------------
1070a0
@@ -1259,7 +1259,7 @@ class Koan:
1070a0
         if len(disks) == 0:
1070a0
             print("paths: ", paths)
1070a0
             print("sizes: ", sizes)
1070a0
-            raise InfoException("Disk configuration not resolvable!")
1070a0
+            raise(InfoException("Disk configuration not resolvable!"))
1070a0
         return disks
1070a0
 
1070a0
     #---------------------------------------------------
1070a0
@@ -1462,13 +1462,13 @@ class Koan:
1070a0
                 os.makedirs(os.path.dirname(location))
1070a0
                 return location
1070a0
             else:
1070a0
-                raise(InfoException, "invalid location: %s" % location)
1070a0
+                raise((InfoException, "invalid location: %s" % location))
1070a0
         elif location.startswith("/dev/"):
1070a0
             # partition
1070a0
             if os.path.exists(location):
1070a0
                 return location
1070a0
             else:
1070a0
-                raise InfoException("virt path is not a valid block device")
1070a0
+                raise(InfoException("virt path is not a valid block device"))
1070a0
         else:
1070a0
             # it's a volume group, verify that it exists
1070a0
             args = "vgs -o vg_name"
1070a0
@@ -1477,7 +1477,7 @@ class Koan:
1070a0
             print(vgnames)
1070a0
 
1070a0
             if vgnames.find(location) == -1:
1070a0
-                raise InfoException("The volume group [%s] does not exist." % location)
1070a0
+                raise(InfoException("The volume group [%s] does not exist." % location))
1070a0
             
1070a0
             # check free space
1070a0
             args = "LANG=C vgs --noheadings -o vg_free --units g %s" % location
1070a0
@@ -1512,13 +1512,13 @@ class Koan:
1070a0
                     print("%s" % args)
1070a0
                     lv_create = sub_process.call(args, shell=True)
1070a0
                     if lv_create != 0:
1070a0
-                        raise InfoException("LVM creation failed")
1070a0
+                        raise(InfoException("LVM creation failed"))
1070a0
 
1070a0
                 # return partition location
1070a0
                 return "/dev/%s/%s" % (location,name)
1070a0
 
1070a0
             else:
1070a0
-                raise InfoException("volume group needs %s GB free space." % virt_size)
1070a0
+                raise(InfoException("volume group needs %s GB free space." % virt_size))
1070a0
 
1070a0
 
1070a0
     def randomUUID(self):
1070a0
diff --git a/koan/qcreate.py b/koan/qcreate.py
1070a0
index 73b6abb..e41a532 100755
1070a0
--- a/koan/qcreate.py
1070a0
+++ b/koan/qcreate.py
1070a0
@@ -38,7 +38,7 @@ def start_install(*args, **kwargs):
1070a0
     try:
1070a0
         import libvirt
1070a0
     except:
1070a0
-        raise app.InfoException("package libvirt is required for installing virtual guests")
1070a0
+        raise(app.InfoException("package libvirt is required for installing virtual guests"))
1070a0
     conn = libvirt.openReadOnly(None)
1070a0
     # See http://libvirt.org/formatcaps.html
1070a0
     capabilities = parseString(conn.getCapabilities())
1070a0
diff --git a/koan/register.py b/koan/register.py
1070a0
index 8ce7db3..0a066f1 100755
1070a0
--- a/koan/register.py
1070a0
+++ b/koan/register.py
1070a0
@@ -124,7 +124,7 @@ class Register:
1070a0
         # not really required, but probably best that ordinary users don't try
1070a0
         # to run this not knowing what it does.
1070a0
         if os.getuid() != 0:
1070a0
-           raise InfoException("root access is required to register")
1070a0
+           raise(InfoException("root access is required to register"))
1070a0
  
1070a0
         print("- preparing to koan home")
1070a0
         self.conn = connect_to_server(self.server, self.port)
1070a0
@@ -144,12 +144,12 @@ class Register:
1070a0
                     hostname = ""
1070a0
                     sysname = str(time.time())
1070a0
                 else:
1070a0
-                    raise InfoException("must specify --fqdn, could not discover")
1070a0
+                    raise(InfoException("must specify --fqdn, could not discover"))
1070a0
             if sysname == "":
1070a0
                 sysname = hostname
1070a0
 
1070a0
         if self.profile == "":
1070a0
-            raise InfoException("must specify --profile")
1070a0
+            raise(InfoException("must specify --profile"))
1070a0
 
1070a0
         # we'll do a profile check here just to avoid some log noise on the remote end.
1070a0
         # network duplication checks and profile checks also happen on the remote end.
1070a0
@@ -166,7 +166,7 @@ class Register:
1070a0
         reg_info['hostname'] = hostname
1070a0
         
1070a0
         if not matched_profile:
1070a0
-            raise InfoException("no such remote profile, see 'koan --list-profiles'") 
1070a0
+            raise(InfoException("no such remote profile, see 'koan --list-profiles'") )
1070a0
 
1070a0
         if not self.batch:
1070a0
             self.conn.register_new_system(reg_info)
1070a0
diff --git a/koan/utils.py b/koan/utils.py
1070a0
index 607db1f..b88ba94 100644
1070a0
--- a/koan/utils.py
1070a0
+++ b/koan/utils.py
1070a0
@@ -92,7 +92,7 @@ def urlread(url):
1070a0
     """
1070a0
     print("- reading URL: %s" % url)
1070a0
     if url is None or url == "":
1070a0
-        raise InfoException("invalid URL: %s" % url)
1070a0
+        raise(InfoException("invalid URL: %s" % url))
1070a0
 
1070a0
     elif url[0:3] == "nfs":
1070a0
         try:
1070a0
@@ -110,7 +110,7 @@ def urlread(url):
1070a0
             return data
1070a0
         except:
1070a0
             traceback.print_exc()
1070a0
-            raise(InfoException, "Couldn't mount and read URL: %s" % url)
1070a0
+            raise((InfoException, "Couldn't mount and read URL: %s" % url))
1070a0
           
1070a0
     elif url[0:4] == "http":
1070a0
         try:
1070a0
@@ -120,7 +120,7 @@ def urlread(url):
1070a0
             return data
1070a0
         except:
1070a0
             traceback.print_exc()
1070a0
-            raise(InfoException, "Couldn't download: %s" % url)
1070a0
+            raise((InfoException, "Couldn't download: %s" % url))
1070a0
     elif url[0:4] == "file":
1070a0
         try:
1070a0
             fd = open(url[5:])
1070a0
@@ -128,10 +128,10 @@ def urlread(url):
1070a0
             fd.close()
1070a0
             return data
1070a0
         except:
1070a0
-            raise InfoException("Couldn't read file from URL: %s" % url)
1070a0
+            raise(InfoException("Couldn't read file from URL: %s" % url))
1070a0
               
1070a0
     else:
1070a0
-        raise InfoException("Unhandled URL protocol: %s" % url)
1070a0
+        raise(InfoException("Unhandled URL protocol: %s" % url))
1070a0
 
1070a0
 def urlgrab(url,saveto):
1070a0
     """
1070a0
@@ -150,7 +150,7 @@ def subprocess_call(cmd,ignore_rc=0):
1070a0
     print("- %s" % cmd)
1070a0
     rc = sub_process.call(cmd)
1070a0
     if rc != 0 and not ignore_rc:
1070a0
-        raise InfoException("command failed (%s)" % rc)
1070a0
+        raise(InfoException("command failed (%s)" % rc))
1070a0
     return rc
1070a0
 
1070a0
 def subprocess_get_response(cmd, ignore_rc=False):
1070a0
@@ -165,7 +165,7 @@ def subprocess_get_response(cmd, ignore_rc=False):
1070a0
     result = result.strip()
1070a0
     rc = p.poll()
1070a0
     if not ignore_rc and rc != 0:
1070a0
-        raise InfoException("command failed (%s)" % rc)
1070a0
+        raise(InfoException("command failed (%s)" % rc))
1070a0
     return rc, result
1070a0
 
1070a0
 def input_string_or_hash(options,delim=None,allow_multiples=True):
1070a0
@@ -178,7 +178,7 @@ def input_string_or_hash(options,delim=None,allow_multiples=True):
1070a0
     if options is None:
1070a0
         return {}
1070a0
     elif type(options) == list:
1070a0
-        raise InfoException("No idea what to do with list: %s" % options)
1070a0
+        raise(InfoException("No idea what to do with list: %s" % options))
1070a0
     elif type(options) == type(""):
1070a0
         new_dict = {}
1070a0
         tokens = options.split(delim)
1070a0
@@ -215,7 +215,7 @@ def input_string_or_hash(options,delim=None,allow_multiples=True):
1070a0
         options.pop('',None)
1070a0
         return options
1070a0
     else:
1070a0
-        raise InfoException("invalid input type: %s" % type(options))
1070a0
+        raise(InfoException("invalid input type: %s" % type(options)))
1070a0
 
1070a0
 def hash_to_string(hash):
1070a0
     """
1070a0
@@ -255,7 +255,7 @@ def nfsmount(input_path):
1070a0
     rc = sub_process.call(mount_cmd)
1070a0
     if not rc == 0:
1070a0
         shutil.rmtree(tempdir, ignore_errors=True)
1070a0
-        raise InfoException("nfs mount failed: %s" % dirpath)
1070a0
+        raise(InfoException("nfs mount failed: %s" % dirpath))
1070a0
     # NOTE: option for a blocking install might be nice, so we could do this
1070a0
     # automatically, if supported by virt-install
1070a0
     print("after install completes, you may unmount and delete %s" % tempdir)
1070a0
@@ -290,7 +290,7 @@ def find_vm(conn, vmid):
1070a0
         if vm.name() == vmid:
1070a0
             return vm
1070a0
      
1070a0
-    raise InfoException("koan could not find the VM to watch: %s" % vmid)
1070a0
+    raise(InfoException("koan could not find the VM to watch: %s" % vmid))
1070a0
 
1070a0
 def get_vm_state(conn, vmid):
1070a0
     """
1070a0
@@ -335,7 +335,7 @@ def os_release():
1070a0
              return (make,float(t))
1070a0
          except ValueError:
1070a0
              pass
1070a0
-      raise InfoException("failed to detect local OS version from /etc/redhat-release")
1070a0
+      raise(InfoException("failed to detect local OS version from /etc/redhat-release"))
1070a0
 
1070a0
    elif check_dist() == "debian":
1070a0
       fd = open("/etc/debian_version")
1070a0
@@ -429,7 +429,7 @@ def connect_to_server(server=None,port=None):
1070a0
     if server is None:
1070a0
         server = os.environ.get("COBBLER_SERVER","")
1070a0
     if server == "":
1070a0
-        raise InfoException("--server must be specified")
1070a0
+        raise(InfoException("--server must be specified"))
1070a0
 
1070a0
     if port is None: 
1070a0
         port = 25151 
1070a0
@@ -445,7 +445,7 @@ def connect_to_server(server=None,port=None):
1070a0
         server = __try_connect(url)
1070a0
         if server is not None:
1070a0
            return server
1070a0
-    raise InfoException ("Could not find Cobbler.")
1070a0
+    raise(InfoException ("Could not find Cobbler."))
1070a0
 
1070a0
 def create_xendomains_symlink(name):
1070a0
     """
1070a0
@@ -459,7 +459,7 @@ def create_xendomains_symlink(name):
1070a0
     if os.path.exists(src) and os.access(os.path.dirname(dst), os.W_OK):
1070a0
         os.symlink(src, dst)
1070a0
     else:
1070a0
-        raise InfoException("Could not create /etc/xen/auto/%s symlink.  Please check write permissions and ownership" % name)
1070a0
+        raise(InfoException("Could not create /etc/xen/auto/%s symlink.  Please check write permissions and ownership" % name))
1070a0
 
1070a0
 def libvirt_enable_autostart(domain_name):
1070a0
    import libvirt
1070a0
@@ -469,10 +469,10 @@ def libvirt_enable_autostart(domain_name):
1070a0
       domain = conn.lookupByName(domain_name)
1070a0
       domain.setAutostart(1)
1070a0
    except:
1070a0
-      raise InfoException("libvirt could not find domain %s" % domain_name)
1070a0
+      raise(InfoException("libvirt could not find domain %s" % domain_name))
1070a0
 
1070a0
    if not domain.autostart:
1070a0
-      raise InfoException("Could not enable autostart on domain %s." % domain_name)
1070a0
+      raise(InfoException("Could not enable autostart on domain %s." % domain_name))
1070a0
 
1070a0
 def make_floppy(kickstart):
1070a0
 
1070a0
@@ -484,14 +484,14 @@ def make_floppy(kickstart):
1070a0
     print("- %s" % cmd)
1070a0
     rc = os.system(cmd)
1070a0
     if not rc == 0:
1070a0
-        raise InfoException("dd failed")
1070a0
+        raise(InfoException("dd failed"))
1070a0
 
1070a0
     # vfatify
1070a0
     cmd = "mkdosfs %s" % floppy_path
1070a0
     print("- %s" % cmd)
1070a0
     rc = os.system(cmd)
1070a0
     if not rc == 0:
1070a0
-        raise InfoException("mkdosfs failed")
1070a0
+        raise(InfoException("mkdosfs failed"))
1070a0
 
1070a0
     # mount the floppy
1070a0
     mount_path = tempfile.mkdtemp(suffix=".mnt", prefix='tmp', dir="/tmp")
1070a0
@@ -499,7 +499,7 @@ def make_floppy(kickstart):
1070a0
     print("- %s" % cmd)
1070a0
     rc = os.system(cmd)
1070a0
     if not rc == 0:
1070a0
-        raise InfoException("mount failed")
1070a0
+        raise(InfoException("mount failed"))
1070a0
 
1070a0
     # download the kickstart file onto the mounted floppy
1070a0
     print("- downloading %s" % kickstart)
1070a0
@@ -511,7 +511,7 @@ def make_floppy(kickstart):
1070a0
     print("- %s" % cmd)
1070a0
     rc = os.system(cmd)
1070a0
     if not rc == 0:
1070a0
-        raise InfoException("umount failed")
1070a0
+        raise(InfoException("umount failed"))
1070a0
 
1070a0
     # return the path to the completed disk image to pass to virt-install
1070a0
     return floppy_path
1070a0
diff --git a/koan/virtinstall.py b/koan/virtinstall.py
1070a0
index de2a670..fbafb43 100644
1070a0
--- a/koan/virtinstall.py
1070a0
+++ b/koan/virtinstall.py
1070a0
@@ -90,7 +90,7 @@ def _sanitize_disks(disks):
1070a0
         if d[1] != 0 or d[0].startswith("/dev"):
1070a0
             ret.append((d[0], d[1], driver_type))
1070a0
         else:
1070a0
-            raise app.InfoException("this virtualization type does not work without a disk image, set virt-size in Cobbler to non-zero")
1070a0
+            raise(app.InfoException("this virtualization type does not work without a disk image, set virt-size in Cobbler to non-zero"))
1070a0
 
1070a0
     return ret
1070a0
 
1070a0
@@ -127,7 +127,7 @@ def _sanitize_nics(nics, bridge, profile_bridge, network_count):
1070a0
             intf_bridge = intf["virt_bridge"]
1070a0
             if intf_bridge == "":
1070a0
                 if profile_bridge == "":
1070a0
-                    raise app.InfoException("virt-bridge setting is not defined in cobbler")
1070a0
+                    raise(app.InfoException("virt-bridge setting is not defined in cobbler"))
1070a0
                 intf_bridge = profile_bridge
1070a0
 
1070a0
         else:
1070a0
@@ -230,12 +230,12 @@ def build_commandline(uri,
1070a0
     if is_import:
1070a0
         importpath = profile_data.get("file")
1070a0
         if not importpath:
1070a0
-            raise app.InfoException("Profile 'file' required for image "
1070a0
-                                     "install")
1070a0
+            raise(app.InfoException("Profile 'file' required for image "
1070a0
+                                     "install"))
1070a0
 
1070a0
     elif "file" in profile_data:
1070a0
         if is_xen:
1070a0
-            raise app.InfoException("Xen does not work with --image yet")
1070a0
+            raise(app.InfoException("Xen does not work with --image yet"))
1070a0
 
1070a0
         # this is an image based installation
1070a0
         input_path = profile_data["file"]
1070a0
@@ -256,7 +256,7 @@ def build_commandline(uri,
1070a0
     elif is_qemu or is_xen:
1070a0
         # images don't need to source this
1070a0
         if not "install_tree" in profile_data:
1070a0
-            raise app.InfoException("Cannot find install source in kickstart file, aborting.")
1070a0
+            raise(app.InfoException("Cannot find install source in kickstart file, aborting."))
1070a0
 
1070a0
         if not profile_data["install_tree"].endswith("/"):
1070a0
             profile_data["install_tree"] = profile_data["install_tree"] + "/"
1070a0
@@ -277,7 +277,7 @@ def build_commandline(uri,
1070a0
             bridge = profile_data["virt_bridge"]
1070a0
 
1070a0
         if bridge == "":
1070a0
-            raise app.InfoException("virt-bridge setting is not defined in cobbler")
1070a0
+            raise(app.InfoException("virt-bridge setting is not defined in cobbler"))
1070a0
         nics = [(bridge, None)]
1070a0
 
1070a0
 
1070a0
diff --git a/koan/vmwcreate.py b/koan/vmwcreate.py
1070a0
index 1b90a27..3e94e1c 100755
1070a0
--- a/koan/vmwcreate.py
1070a0
+++ b/koan/vmwcreate.py
1070a0
@@ -82,7 +82,7 @@ def make_disk(disksize,image):
1070a0
     print("- %s" % cmd)
1070a0
     rc = os.system(cmd)
1070a0
     if rc != 0:
1070a0
-       raise VirtCreateException("command failed")
1070a0
+       raise(VirtCreateException("command failed"))
1070a0
 
1070a0
 def make_vmx(path,vmdk_image,image_name,mac_address,memory):
1070a0
     template_params =  {
1070a0
@@ -101,7 +101,7 @@ def register_vmx(vmx_file):
1070a0
     print("- %s" % cmd)
1070a0
     rc = os.system(cmd)
1070a0
     if rc!=0:
1070a0
-       raise VirtCreateException("vmware registration failed")
1070a0
+       raise(VirtCreateException("vmware registration failed"))
1070a0
     
1070a0
 def start_vm(vmx_file):
1070a0
     os.chmod(vmx_file, 0o755)
1070a0
@@ -109,7 +109,7 @@ def start_vm(vmx_file):
1070a0
     print("- %s" % cmd)
1070a0
     rc = os.system(cmd)
1070a0
     if rc != 0:
1070a0
-       raise VirtCreateException("vm start failed")
1070a0
+       raise(VirtCreateException("vm start failed"))
1070a0
 
1070a0
 def start_install(name=None, 
1070a0
                   ram=None, 
1070a0
@@ -127,7 +127,7 @@ def start_install(name=None,
1070a0
                   virt_auto_boot=False):
1070a0
 
1070a0
     if "file" in profile_data:
1070a0
-        raise app.InfoException("vmware does not work with --image yet")
1070a0
+        raise(app.InfoException("vmware does not work with --image yet"))
1070a0
 
1070a0
     mac = None
1070a0
     if not "interfaces" in profile_data:
1070a0
@@ -154,7 +154,7 @@ def start_install(name=None,
1070a0
         os.makedirs(VMX_DIR)
1070a0
 
1070a0
     if len(disks) != 1:
1070a0
-       raise VirtCreateException("vmware support is limited to 1 virtual disk")
1070a0
+       raise(VirtCreateException("vmware support is limited to 1 virtual disk"))
1070a0
 
1070a0
     diskname = disks[0][0]
1070a0
     disksize = disks[0][1]
1070a0
-- 
1070a0
2.5.5
1070a0