[blivet:master 13/14] Raise exceptions using the new syntax

mulhern amulhern at redhat.com
Fri Mar 28 22:50:38 UTC 2014


Signed-off-by: mulhern <amulhern at redhat.com>
---
 tests/devicelibs_test/baseclass.py  | 8 ++++----
 tests/devicelibs_test/btrfs_test.py | 4 ++--
 2 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/tests/devicelibs_test/baseclass.py b/tests/devicelibs_test/baseclass.py
index 984ed74..e2faef0 100644
--- a/tests/devicelibs_test/baseclass.py
+++ b/tests/devicelibs_test/baseclass.py
@@ -13,7 +13,7 @@ def makeLoopDev(device_name, file_name):
             rc = proc.returncode
             break
     if rc:
-        raise OSError, "dd failed creating the file %s" % file_name
+        raise OSError("dd failed creating the file %s" % file_name)
 
     proc = subprocess.Popen(["losetup", device_name, file_name],
                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
@@ -23,7 +23,7 @@ def makeLoopDev(device_name, file_name):
             rc = proc.returncode
             break
     if rc:
-        raise OSError, "losetup failed setting up the loop device %s" % device_name
+        raise OSError("losetup failed setting up the loop device %s" % device_name)
 
 def removeLoopDev(device_name, file_name):
     proc = subprocess.Popen(["losetup", "-d", device_name],
@@ -34,7 +34,7 @@ def removeLoopDev(device_name, file_name):
             rc = proc.returncode
             break
     if rc:
-        raise OSError, "losetup failed removing the loop device %s" % device_name
+        raise OSError("losetup failed removing the loop device %s" % device_name)
 
     os.unlink(file_name)
 
@@ -54,7 +54,7 @@ def getFreeLoopDev():
             break
 
     if rc:
-        raise OSError, "losetup failed to find a free device"
+        raise OSError("losetup failed to find a free device")
 
     return out
 
diff --git a/tests/devicelibs_test/btrfs_test.py b/tests/devicelibs_test/btrfs_test.py
index 8c575d1..43e9a89 100755
--- a/tests/devicelibs_test/btrfs_test.py
+++ b/tests/devicelibs_test/btrfs_test.py
@@ -33,7 +33,7 @@ class BTRFSMountDevice(baseclass.DevicelibsTestCase):
         self.mountpoint = tempfile.mkdtemp()
         rc = subprocess.call(["mount", self.device, self.mountpoint])
         if rc:
-            raise OSError, "mount failed to mount device %s" % device
+            raise OSError("mount failed to mount device %s" % self.device)
 
     def tearDown(self):
         """Before the DevicelibsTestCase cleanup unmount the device and
@@ -46,7 +46,7 @@ class BTRFSMountDevice(baseclass.DevicelibsTestCase):
                 rc = proc.returncode
                 break
         if rc:
-            raise OSError, "failed to unmount device %s" % self.device
+            raise OSError("failed to unmount device %s" % self.device)
 
         os.rmdir(self.mountpoint)
         baseclass.DevicelibsTestCase.tearDown(self)
-- 
1.8.3.1



More information about the anaconda-patches mailing list