[blivet:master 10/10] Replace with a semantically equivalent chunk.
mulhern
amulhern at redhat.com
Wed Mar 26 16:24:10 UTC 2014
This was motivated by a complaint about unused variable path.
Signed-off-by: mulhern <amulhern at redhat.com>
---
blivet/devices.py | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/blivet/devices.py b/blivet/devices.py
index 50c8dd1..25cffbe 100644
--- a/blivet/devices.py
+++ b/blivet/devices.py
@@ -1310,12 +1310,9 @@ class PartitionDevice(StorageDevice):
def _setPartedPartition(self, partition):
""" Set this PartitionDevice's parted Partition instance. """
log_method_call(self, self.name)
- if partition is None:
- path = None
- elif isinstance(partition, parted.Partition):
- path = partition.path
- else:
- raise ValueError("partition must be a parted.Partition instance")
+
+ if partition is not None and not isinstance(partition, parted.Partition):
+ raise ValueError("partition must be None or a parted.Partition instance")
log.debug("device %s new partedPartition %s", self.name, partition)
self._partedPartition = partition
--
1.8.3.1
More information about the anaconda-patches
mailing list