[anaconda:master 3/4] Updates for new blivet.size.Size.__new__ interface.

mulhern amulhern at redhat.com
Thu May 1 13:11:28 UTC 2014


Remove uses of SizeParamsError since it is no longer used.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 pyanaconda/bootloader.py                           |  4 +--
 pyanaconda/installclass.py                         |  8 +++---
 pyanaconda/kickstart.py                            | 23 ++++++++---------
 pyanaconda/packaging/dnfpayload.py                 |  6 ++---
 pyanaconda/packaging/livepayload.py                |  6 ++---
 pyanaconda/packaging/yumpayload.py                 |  4 +--
 pyanaconda/storage_utils.py                        |  7 +++--
 pyanaconda/ui/gui/spokes/custom.py                 |  4 +--
 pyanaconda/ui/gui/spokes/lib/cart.py               |  8 +++---
 .../ui/gui/spokes/lib/custom_storage_helpers.py    |  4 +--
 pyanaconda/ui/gui/spokes/lib/resize.py             | 30 +++++++++++-----------
 pyanaconda/ui/gui/spokes/storage.py                |  8 +++---
 pyanaconda/ui/lib/space.py                         |  4 +--
 pyanaconda/ui/tui/spokes/storage.py                |  4 +--
 tests/gui/outside/__init__.py                      |  4 +--
 tests/storage/cases/bz1014545.py                   |  8 +++---
 tests/storage/cases/bz1067707.py                   |  2 +-
 17 files changed, 66 insertions(+), 68 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index dc85d79..a36f086 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -244,7 +244,7 @@ class BootLoader(object):
     stage2_bootable = False
     stage2_must_be_primary = True
     stage2_description = N_("/boot filesystem")
-    stage2_max_end = Size(spec="2 TiB")
+    stage2_max_end = Size("2 TiB")
 
     @property
     def stage2_format_types(self):
@@ -492,7 +492,7 @@ class BootLoader(object):
         if max_end and device.type == "partition" and device.partedPartition:
             end_sector = device.partedPartition.geometry.end
             sector_size = device.partedPartition.disk.device.sectorSize
-            end = Size(bytes=sector_size * end_sector)
+            end = Size(sector_size * end_sector)
             if end > max_end:
                 self.errors.append(_("%(desc)s must be within the first %(max_end)s of "
                                      "the disk.") % {"desc": desc, "max_end": max_end})
diff --git a/pyanaconda/installclass.py b/pyanaconda/installclass.py
index f3d4bc5..9c125a1 100644
--- a/pyanaconda/installclass.py
+++ b/pyanaconda/installclass.py
@@ -79,14 +79,14 @@ class BaseInstallClass(object):
 
     def setDefaultPartitioning(self, storage):
         autorequests = [PartSpec(mountpoint="/", fstype=storage.defaultFSType,
-                                 size=Size(spec="1GiB"),
-                                 maxSize=Size(spec="50GiB"),
+                                 size=Size("1GiB"),
+                                 maxSize=Size("50GiB"),
                                  grow=True,
                                  btr=True, lv=True, thin=True, encrypted=True),
                         PartSpec(mountpoint="/home",
                                  fstype=storage.defaultFSType,
-                                 size=Size(spec="500MiB"), grow=True,
-                                 requiredSpace=Size(spec="50GiB"),
+                                 size=Size("500MiB"), grow=True,
+                                 requiredSpace=Size("50GiB"),
                                  btr=True, lv=True, thin=True, encrypted=True)]
 
         bootreqs = platform.setDefaultPartitioning()
diff --git a/pyanaconda/kickstart.py b/pyanaconda/kickstart.py
index c1f016a..a8c6b4a 100644
--- a/pyanaconda/kickstart.py
+++ b/pyanaconda/kickstart.py
@@ -23,7 +23,6 @@ from blivet.deviceaction import ActionCreateFormat, ActionDestroyFormat, ActionR
 from blivet.devices import LUKSDevice
 from blivet.devicelibs.lvm import getPossiblePhysicalExtents
 from blivet.devicelibs import swap
-from blivet.errors import SizeParamsError
 from blivet.formats import getFormat
 from blivet.partitioning import doPartitioning
 from blivet.partitioning import growLVM
@@ -713,8 +712,8 @@ class LogVolData(commands.logvol.F20_LogVolData):
         vgname = ksdata.onPart.get(self.vgname, self.vgname)
 
         try:
-            size = Size(spec="%d MiB" % self.size)
-        except (ValueError, SizeParamsError):
+            size = Size("%d MiB" % self.size)
+        except ValueError:
             raise KickstartValueError(formatErrorMsg(self.lineno, msg="The size %s is not valid." % self.size))
         except TypeError:
             pass
@@ -850,15 +849,15 @@ class LogVolData(commands.logvol.F20_LogVolData):
                 parents = [vg]
 
             if self.thin_pool:
-                pool_args = { "metadatasize": Size(spec="%d MiB" % self.metadata_size),
-                              "chunksize": Size(spec="%d KiB" % self.chunk_size) }
+                pool_args = { "metadatasize": Size("%d MiB" % self.metadata_size),
+                              "chunksize": Size("%d KiB" % self.chunk_size) }
             else:
                 pool_args = {}
 
             if self.maxSizeMB:
                 try:
-                    maxsize = Size(spec="%d MiB" % self.maxSizeMB)
-                except (ValueError, SizeParamsError):
+                    maxsize = Size("%d MiB" % self.maxSizeMB)
+                except ValueError:
                     raise KickstartValueError(formatErrorMsg(self.lineno, msg="The maximum size %s is not valid." % self.maxSizeMB))
                 except TypeError:
                     pass
@@ -949,8 +948,8 @@ class PartitionData(commands.partition.F18_PartData):
         storage.doAutoPart = False
 
         try:
-            size = Size(spec="%d MiB" % self.size)
-        except (ValueError, SizeParamsError):
+            size = Size("%d MiB" % self.size)
+        except ValueError:
             raise KickstartValueError(formatErrorMsg(self.lineno, msg="The size %s is not valid." % self.size))
         except TypeError:
             pass
@@ -1105,8 +1104,8 @@ class PartitionData(commands.partition.F18_PartData):
         kwargs["size"] = size
         if self.maxSizeMB:
             try:
-                maxsize = Size(spec="%d MiB" % self.maxSizeMB)
-            except (ValueError, SizeParamsError):
+                maxsize = Size("%d MiB" % self.maxSizeMB)
+            except ValueError:
                 raise KickstartValueError(formatErrorMsg(self.lineno, msg="The maximum size %s is not valid." % self.maxSizeMB))
             except TypeError:
                 pass
@@ -1506,7 +1505,7 @@ class VolGroupData(commands.volgroup.FC16_VolGroupData):
         if len(pvs) == 0 and not self.preexist:
             raise KickstartValueError(formatErrorMsg(self.lineno, msg="Volume group defined without any physical volumes.  Either specify physical volumes or use --useexisting."))
 
-        pesize = Size(spec="%d KiB" % self.pesize)
+        pesize = Size("%d KiB" % self.pesize)
         if pesize not in getPossiblePhysicalExtents():
             raise KickstartValueError(formatErrorMsg(self.lineno, msg="Volume group specified invalid pesize"))
 
diff --git a/pyanaconda/packaging/dnfpayload.py b/pyanaconda/packaging/dnfpayload.py
index 1d58c6d..2995b98 100644
--- a/pyanaconda/packaging/dnfpayload.py
+++ b/pyanaconda/packaging/dnfpayload.py
@@ -82,7 +82,7 @@ def _df_map():
         val = items[1]
         if not key.startswith('/'):
             continue
-        structured[key] = Size(bytes=int(val)*1024)
+        structured[key] = Size(int(val)*1024)
     return structured
 
 def _paced(fn):
@@ -100,7 +100,7 @@ def _pick_mpoint(df, requested):
         return mpoint in DOWNLOAD_MPOINTS
 
     # reserve extra
-    requested = requested + Size(spec="150 MB")
+    requested = requested + Size("150 MB")
     sufficients = {key : val for (key,val) in df.items() if val > requested
                    and reasonable_mpoint(key)}
     log.info('Sufficient mountpoints found: %s', sufficients)
@@ -377,7 +377,7 @@ class DNFPayload(packaging.PackagePayload):
     def spaceRequired(self):
         transaction = self._base.transaction
         if transaction is None:
-            return Size(spec="3000 MB")
+            return Size("3000 MB")
 
         size = sum(tsi.installed.installsize for tsi in transaction)
         # add 35% to account for the fact that the above method is laughably
diff --git a/pyanaconda/packaging/livepayload.py b/pyanaconda/packaging/livepayload.py
index e61cb3c..42f9793 100644
--- a/pyanaconda/packaging/livepayload.py
+++ b/pyanaconda/packaging/livepayload.py
@@ -163,7 +163,7 @@ class LiveImagePayload(ImagePayload):
 
     @property
     def spaceRequired(self):
-        return Size(bytes=iutil.getDirSize("/")*1024)
+        return Size(iutil.getDirSize("/")*1024)
 
 class URLGrabberProgress(object):
     """ Provide methods for urlgrabber progress."""
@@ -410,6 +410,6 @@ class LiveImageKSPayload(LiveImagePayload):
             and install.
         """
         if self._min_size:
-            return Size(bytes=self._min_size)
+            return Size(self._min_size)
         else:
-            return Size(bytes=1024*1024*1024)
+            return Size(1024*1024*1024)
diff --git a/pyanaconda/packaging/yumpayload.py b/pyanaconda/packaging/yumpayload.py
index 878b28e..58b2309 100644
--- a/pyanaconda/packaging/yumpayload.py
+++ b/pyanaconda/packaging/yumpayload.py
@@ -186,7 +186,7 @@ class YumPayload(PackagePayload):
         # This value comes from a default install of the x86_64 Fedora 18.  It
         # is meant as a best first guess only.  Once package metadata is
         # available we can use that as a better value.
-        self._space_required = Size(spec="3000 MB")
+        self._space_required = Size("3000 MB")
 
         self._groups = None
         self._packages = []
@@ -1165,7 +1165,7 @@ reposdir=%s
 
         total += total * 0.35   # add 35% to account for the fact that the above
                                 # method is laughably inaccurate
-        self._space_required = Size(bytes=total)
+        self._space_required = Size(total)
 
         return self._space_required
 
diff --git a/pyanaconda/storage_utils.py b/pyanaconda/storage_utils.py
index cda754a..6478282 100644
--- a/pyanaconda/storage_utils.py
+++ b/pyanaconda/storage_utils.py
@@ -26,7 +26,6 @@ import locale
 from contextlib import contextmanager
 
 from blivet.size import Size
-from blivet.errors import SizeParamsError
 from blivet.devicefactory import DEVICE_TYPE_LVM
 from blivet.devicefactory import DEVICE_TYPE_LVM_THINP
 from blivet.devicefactory import DEVICE_TYPE_BTRFS
@@ -105,13 +104,13 @@ def size_from_input(input_str):
         input_str += "MiB"
 
     try:
-        size = Size(spec=input_str)
-    except (SizeParamsError, ValueError):
+        size = Size(input_str)
+    except ValueError:
         return None
     else:
         # Minimium size for ui-created partitions is 1MiB.
         if size.convertTo(spec="MiB") < 1:
-            size = Size(spec="1 MiB")
+            size = Size("1 MiB")
 
     return size
 
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 6aee6b0..ed5129f 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -146,7 +146,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
         self._error = None
         self._hidden_disks = []
         self._fs_types = []             # list of supported fstypes
-        self._free_space = Size(bytes=0)
+        self._free_space = Size(0)
 
         self._device_size_text = None
         self._device_disks = []
@@ -323,7 +323,7 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
     def _currentTotalSpace(self):
         """Add up the sizes of all selected disks and return it as a Size."""
         totalSpace = sum((disk.size for disk in self._clearpartDevices),
-                         Size(bytes=0))
+                         Size(0))
         return totalSpace
 
     def _updateSpaceDisplay(self):
diff --git a/pyanaconda/ui/gui/spokes/lib/cart.py b/pyanaconda/ui/gui/spokes/lib/cart.py
index 2cff0aa..90b9818 100644
--- a/pyanaconda/ui/gui/spokes/lib/cart.py
+++ b/pyanaconda/ui/gui/spokes/lib/cart.py
@@ -124,11 +124,11 @@ class SelectedDisksDialog(GUIObject):
         free = 0
         for row in self._store:
             count += 1
-            size += Size(spec=row[SIZE_COL])
-            free += Size(spec=row[FREE_SPACE_COL])
+            size += Size(row[SIZE_COL])
+            free += Size(row[FREE_SPACE_COL])
 
-        size = str(Size(bytes=long(size))).upper()
-        free = str(Size(bytes=long(free))).upper()
+        size = str(Size(long(size))).upper()
+        free = str(Size(long(free))).upper()
 
         # pylint: disable=unescaped-markup
         text = P_("<b>%(count)d disk; %(size)s capacity; %(free)s free space</b> "
diff --git a/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.py b/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.py
index b2117f5..fae69d2 100644
--- a/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.py
+++ b/pyanaconda/ui/gui/spokes/lib/custom_storage_helpers.py
@@ -166,7 +166,7 @@ class AddDialog(GUIObject):
     def __init__(self, *args, **kwargs):
         self.mountpoints = kwargs.pop("mountpoints", [])
         GUIObject.__init__(self, *args, **kwargs)
-        self.size = Size(bytes=0)
+        self.size = Size(0)
         self.mountpoint = ""
         self._error = False
 
@@ -323,7 +323,7 @@ class ContainerDialog(GUIObject):
         self.exists = kwargs.pop("exists", False)
 
         self.size_policy = kwargs.pop("size_policy", SIZE_POLICY_AUTO)
-        self.size = kwargs.pop("size", Size(bytes=0))
+        self.size = kwargs.pop("size", Size(0))
 
         self._error = None
         GUIObject.__init__(self, *args, **kwargs)
diff --git a/pyanaconda/ui/gui/spokes/lib/resize.py b/pyanaconda/ui/gui/spokes/lib/resize.py
index 327c194..5756e62 100644
--- a/pyanaconda/ui/gui/spokes/lib/resize.py
+++ b/pyanaconda/ui/gui/spokes/lib/resize.py
@@ -65,8 +65,8 @@ class ResizeDialog(GUIObject):
         self.storage = storage
         self.payload = payload
 
-        self._initialFreeSpace = Size(bytes=0)
-        self._selectedReclaimableSpace = Size(bytes=0)
+        self._initialFreeSpace = Size(0)
+        self._selectedReclaimableSpace = Size(0)
 
         self._actionStore = self.builder.get_object("actionStore")
         self._diskStore = self.builder.get_object("diskStore")
@@ -117,10 +117,10 @@ class ResizeDialog(GUIObject):
 
     def populate(self, disks):
         totalDisks = 0
-        totalReclaimableSpace = Size(bytes=0)
+        totalReclaimableSpace = Size(0)
 
-        self._initialFreeSpace = Size(bytes=0)
-        self._selectedReclaimableSpace = Size(bytes=0)
+        self._initialFreeSpace = Size(0)
+        self._selectedReclaimableSpace = Size(0)
 
         canShrinkSomething = False
 
@@ -132,7 +132,7 @@ class ResizeDialog(GUIObject):
 
             if disk.partitioned:
                 fstype = ""
-                diskReclaimableSpace = Size(bytes=0)
+                diskReclaimableSpace = Size(0)
             else:
                 fstype = disk.format.name
                 diskReclaimableSpace = disk.size
@@ -186,7 +186,7 @@ class ResizeDialog(GUIObject):
             # And then add another uneditable line that lists how much space is
             # already free in the disk.
             diskFree = free_space[disk.name][0]
-            if diskFree >= Size(spec="1MiB"):
+            if diskFree >= Size("1MiB"):
                 freeSpaceString = "<span foreground='grey' style='italic'>%s</span>" % \
                         escape_markup(_("Free space"))
                 self._diskStore.append(itr, [disk.id,
@@ -297,7 +297,7 @@ class ResizeDialog(GUIObject):
         self._shrinkButton.set_sensitive(device.resizable)
 
         if device.resizable:
-            self._setup_slider(device, Size(bytes=obj.target))
+            self._setup_slider(device, Size(obj.target))
 
         # Then, disable the button for whatever action is currently selected.
         # It doesn't make a lot of sense to allow clicking that.
@@ -347,7 +347,7 @@ class ResizeDialog(GUIObject):
         if obj.action == _(PRESERVE):
             return False
         if obj.action == _(SHRINK):
-            self._selectedReclaimableSpace += device.size - Size(bytes=obj.target)
+            self._selectedReclaimableSpace += device.size - Size(obj.target)
         elif obj.action == _(DELETE):
             self._selectedReclaimableSpace += int(device.size)
 
@@ -401,7 +401,7 @@ class ResizeDialog(GUIObject):
 
         # And then we're keeping a running tally of how much space the user
         # has selected to reclaim, so reflect that in the UI.
-        self._selectedReclaimableSpace = Size(bytes=0)
+        self._selectedReclaimableSpace = Size(0)
         self._diskStore.foreach(self._sumReclaimableSpace, None)
         self._update_labels(selectedReclaimable=self._selectedReclaimableSpace)
 
@@ -436,7 +436,7 @@ class ResizeDialog(GUIObject):
         elif obj.action == _(SHRINK) and int(device.size) != int(obj.target):
             if device.resizable:
                 # round this up to nearest MB? MiB? Maybe in targetSize setter.
-                self.storage.resizeDevice(device, Size(bytes=obj.target))
+                self.storage.resizeDevice(device, Size(obj.target))
             else:
                 self._recursiveRemove(device)
         elif obj.action == _(DELETE):
@@ -493,14 +493,14 @@ class ResizeDialog(GUIObject):
     def on_resize_value_changed(self, rng):
         (model, itr) = self._selection.get_selected()
 
-        old_delta = Size(bytes=rng.get_adjustment().get_upper()) - int(model[itr][RESIZE_TARGET_COL])
+        old_delta = Size(rng.get_adjustment().get_upper()) - int(model[itr][RESIZE_TARGET_COL])
         self._selectedReclaimableSpace -= old_delta
 
         # Update the target size in the store.
-        model[itr][RESIZE_TARGET_COL] = Size(bytes=rng.get_value())
+        model[itr][RESIZE_TARGET_COL] = Size(rng.get_value())
 
         # Update the "Total selected space" label.
-        delta = Size(bytes=rng.get_adjustment().get_upper()) - int(rng.get_value())
+        delta = Size(rng.get_adjustment().get_upper()) - int(rng.get_value())
         self._selectedReclaimableSpace += delta
         self._update_labels(selectedReclaimable=self._selectedReclaimableSpace)
 
@@ -510,4 +510,4 @@ class ResizeDialog(GUIObject):
     def resize_slider_format(self, scale, value):
         # This makes the value displayed under the slider prettier than just a
         # single number.
-        return str(Size(bytes=value))
+        return str(Size(value))
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 8a8a4c6..118f471 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -571,8 +571,8 @@ class StorageSpoke(NormalSpoke, StorageChecker):
     def _update_summary(self):
         """ Update the summary based on the UI. """
         count = 0
-        capacity = Size(bytes=0)
-        free = Size(bytes=0)
+        capacity = Size(0)
+        free = Size(0)
 
         # pass in our disk list so hidden disks' free space is available
         free_space = self.storage.getFreeSpace(disks=self.disks)
@@ -734,7 +734,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
 
         # show the installation options dialog
         disks = [d for d in self.disks if d.name in self.selected_disks]
-        disks_size = sum((d.size for d in disks), Size(bytes=0))
+        disks_size = sum((d.size for d in disks), Size(0))
 
         # No disks selected?  The user wants to back out of the storage spoke.
         if not disks:
@@ -785,7 +785,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
 
         required_space = self.payload.spaceRequired
         auto_swap = sum((r.size for r in self.storage.autoPartitionRequests
-                                if r.fstype == "swap"), Size(bytes=0))
+                                if r.fstype == "swap"), Size(0))
 
         log.debug("disk free: %s  fs free: %s  sw needs: %s  auto swap: %s",
                   disk_free, fs_free, required_space, auto_swap)
diff --git a/pyanaconda/ui/lib/space.py b/pyanaconda/ui/lib/space.py
index 18ffe7f..8583eff 100644
--- a/pyanaconda/ui/lib/space.py
+++ b/pyanaconda/ui/lib/space.py
@@ -54,7 +54,7 @@ class FileSystemSpaceChecker(object):
            check again.
         """
         self.success = False
-        self.deficit = Size(bytes=0)
+        self.deficit = Size(0)
         self.error_message = ""
 
     def check(self):
@@ -71,7 +71,7 @@ class FileSystemSpaceChecker(object):
                             in the info bar at the bottom of a Hub.
         """
         self.reset()
-        free = Size(bytes=self.storage.fileSystemFreeSpace)
+        free = Size(self.storage.fileSystemFreeSpace)
         needed = self.payload.spaceRequired
         log.info("fs space: %s  needed: %s", free, needed)
         self.success = (free >= needed)
diff --git a/pyanaconda/ui/tui/spokes/storage.py b/pyanaconda/ui/tui/spokes/storage.py
index cb43d98..ec3944f 100644
--- a/pyanaconda/ui/tui/spokes/storage.py
+++ b/pyanaconda/ui/tui/spokes/storage.py
@@ -156,7 +156,7 @@ class StorageSpoke(NormalTUISpoke):
         """ Update the summary based on the UI. """
         count = 0
         capacity = 0
-        free = Size(bytes=0)
+        free = Size(0)
 
         # pass in our disk list so hidden disks' free space is available
         free_space = self.storage.getFreeSpace(disks=self.disks)
@@ -169,7 +169,7 @@ class StorageSpoke(NormalTUISpoke):
 
         summary = (P_(("%d disk selected; %s capacity; %s free ..."),
                       ("%d disks selected; %s capacity; %s free ..."),
-                      count) % (count, str(Size(bytes=capacity)), free))
+                      count) % (count, str(Size(capacity)), free))
 
         if len(self.disks) == 0:
             summary = _("No disks detected.  Please shut down the computer, connect at least one disk, and restart to complete installation.")
diff --git a/tests/gui/outside/__init__.py b/tests/gui/outside/__init__.py
index 918a23b..e4feeb0 100644
--- a/tests/gui/outside/__init__.py
+++ b/tests/gui/outside/__init__.py
@@ -133,7 +133,7 @@ class Creator(object):
         b = blivet.Blivet()
 
         # pylint: disable=undefined-variable
-        disk1_path = create_sparse_file(b, "suite", blivet.size.Size(spec="11 MB"))
+        disk1_path = create_sparse_file(b, "suite", blivet.size.Size("11 MB"))
         b.config.diskImages["suite"] = disk1_path
 
         b.reset()
@@ -142,7 +142,7 @@ class Creator(object):
             disk1 = b.devicetree.getDeviceByName("suite")
             b.initializeDisk(disk1)
 
-            part = b.newPartition(size=blivet.size.Size(spec="10 MB"), parents=[disk1])
+            part = b.newPartition(size=blivet.size.Size("10 MB"), parents=[disk1])
             b.createDevice(part)
 
             fmt = blivet.formats.getFormat("ext4", label="ANACTEST", mountpoint=self.mountpoint)
diff --git a/tests/storage/cases/bz1014545.py b/tests/storage/cases/bz1014545.py
index b57fa4f..6aa8ba1 100644
--- a/tests/storage/cases/bz1014545.py
+++ b/tests/storage/cases/bz1014545.py
@@ -27,7 +27,7 @@ class BTRFSOnNonBTRFSComponent(TestCaseComponent):
 
     def __init__(self, *args, **kwargs):
         TestCaseComponent.__init__(self, *args, **kwargs)
-        self.disksToCreate = [("anatest-disk1", Size(spec="1GiB"))]
+        self.disksToCreate = [("anatest-disk1", Size("1GiB"))]
 
     @property
     def ks(self):
@@ -50,7 +50,7 @@ class VolGroupOnNonPVsComponent(TestCaseComponent):
 
     def __init__(self, *args, **kwargs):
         TestCaseComponent.__init__(self, *args, **kwargs)
-        self.disksToCreate = [("anatest-disk1", Size(spec="1GiB"))]
+        self.disksToCreate = [("anatest-disk1", Size("1GiB"))]
 
     @property
     def ks(self):
@@ -73,8 +73,8 @@ class RaidOnNonRaidMembersComponent(TestCaseComponent):
 
     def __init__(self, *args, **kwargs):
         TestCaseComponent.__init__(self, *args, **kwargs)
-        self.disksToCreate = [("anatest-disk1", Size(spec="1GiB")),
-                              ("anatest-disk2", Size(spec="1GiB"))]
+        self.disksToCreate = [("anatest-disk1", Size("1GiB")),
+                              ("anatest-disk2", Size("1GiB"))]
 
     @property
     def ks(self):
diff --git a/tests/storage/cases/bz1067707.py b/tests/storage/cases/bz1067707.py
index 20d1c33..e49e4fc 100644
--- a/tests/storage/cases/bz1067707.py
+++ b/tests/storage/cases/bz1067707.py
@@ -25,7 +25,7 @@ class SwapWithRecommendedSizeComponent(TestCaseComponent):
 
     def __init__(self, *args, **kwargs):
         TestCaseComponent.__init__(self, *args, **kwargs)
-        self.disksToCreate = [("anatest-disk1", Size(spec="1GiB"))]
+        self.disksToCreate = [("anatest-disk1", Size("1GiB"))]
 
     @property
     def ks(self):
-- 
1.8.3.1



More information about the anaconda-patches mailing list