[blivet:master 6/7] Remove appendiceal assignments
mulhern
amulhern at redhat.com
Thu Mar 27 14:39:02 UTC 2014
These all look like they were valuable to some code once and that code went
away, but they remained.
Signed-off-by: mulhern <amulhern at redhat.com>
---
blivet/__init__.py | 1 -
blivet/devicefactory.py | 1 -
blivet/devicetree.py | 7 -------
blivet/partitioning.py | 4 ----
tests/size_test.py | 1 -
5 files changed, 14 deletions(-)
diff --git a/blivet/__init__.py b/blivet/__init__.py
index ba8816d..dd4f487 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -2727,7 +2727,6 @@ class FSSet(object):
device.format.mountpoint))
while os.path.exists("%s/%s" % (basedir, filename)) or \
self.devicetree.getDeviceByName(filename):
- file = os.path.normpath("%s/%s" % (basedir, filename))
count += 1
filename = "/SWAP-%d" % count
diff --git a/blivet/devicefactory.py b/blivet/devicefactory.py
index f20b095..1dd4353 100644
--- a/blivet/devicefactory.py
+++ b/blivet/devicefactory.py
@@ -631,7 +631,6 @@ class DeviceFactory(object):
exists=False)
self.storage.formatDevice(self.device, new_format)
else:
- current_mountpoint = getattr(current_format, "mountpoint", None)
if (hasattr(current_format, "mountpoint") and
current_format.mountpoint != self.mountpoint):
current_format.mountpoint = self.mountpoint
diff --git a/blivet/devicetree.py b/blivet/devicetree.py
index 354cf37..2b28a9d 100644
--- a/blivet/devicetree.py
+++ b/blivet/devicetree.py
@@ -871,11 +871,6 @@ class DeviceTree(object):
devicelibs.lvm.lvm_cc_addFilterRejectRegexp(name)
return
- # Sun disklabels have a partition that spans the entire disk as
- # partition 3. It does not appear in the partition list. Fantastic.
- is_sun_magic = (getattr(disk.format, "labelType", None) == "sun" and
- udev_device_get_minor(info) == 3)
-
if not disk.partitioned:
# Ignore partitions on:
# - devices we do not support partitioning of, like logical volumes
@@ -1432,7 +1427,6 @@ class DeviceTree(object):
# the end
indices = range(len(lv_names))
indices.sort(key=lambda i: lv_attrs[i], cmp=lv_attr_cmp)
- lv_real_names = [n.replace("[", "").replace("]", "") for n in lv_names]
raid = dict([("%s-%s" % (vg_device.name,
n.replace("[", "").replace("]", "")),
{"copies": 0, "log": Size(bytes=0), "meta": Size(bytes=0)})
@@ -1742,7 +1736,6 @@ class DeviceTree(object):
# we fall through to handle that.
return
- format = None
if (not device) or (not format_type) or device.format.type:
# this device has no formatting or it has already been set up
# FIXME: this probably needs something special for disklabels
diff --git a/blivet/partitioning.py b/blivet/partitioning.py
index 3269ee4..7755be5 100644
--- a/blivet/partitioning.py
+++ b/blivet/partitioning.py
@@ -1002,7 +1002,6 @@ def allocatePartitions(storage, disks, partitions, freespace):
# loop through disks
for _disk in req_disks:
disklabel = disklabels[_disk.path]
- sectorSize = Size(bytes=disklabel.partedDevice.sectorSize)
best = None
current_free = free
@@ -1699,7 +1698,6 @@ class VGChunk(Chunk):
self.sortRequests()
# grow the percentage-based requests
- last_pool = self.pool
for req in self.requests:
if req.done or not req.device.req_percent:
continue
@@ -1711,7 +1709,6 @@ class VGChunk(Chunk):
growth, self.lengthToSize(growth),
req.device.id, req.device.name)
- new_base = self.trimOverGrownRequest(req)
log.debug("new grow amount for request %d (%s) is %d "
"units, or %s",
req.device.id, req.device.name, req.growth,
@@ -2028,7 +2025,6 @@ def growPartitions(disks, partitions, free, size_sets=None):
if ptype == parted.PARTITION_LOGICAL:
start += disklabel.alignment.grainSize
- old_geometry = p.device.partedPartition.geometry
new_length = p.base + p.growth
end = start + new_length - 1
# align end sector as needed
diff --git a/tests/size_test.py b/tests/size_test.py
index 60c7e65..0e43559 100644
--- a/tests/size_test.py
+++ b/tests/size_test.py
@@ -82,7 +82,6 @@ class SizeTestCase(unittest.TestCase):
self.assertEquals(s.convertTo(spec="b"), -524288000)
def testPartialBytes(self):
- s = Size(bytes=1024.6)
self.assertEquals(Size(bytes=1024.6), Size(bytes=1024))
self.assertEquals(Size(spec="%s KiB" % (1/1025.0,)), Size(bytes=0))
self.assertEquals(Size(spec="%s KiB" % (1/1023.0,)), Size(bytes=1))
--
1.8.3.1
More information about the anaconda-patches
mailing list