[blivet:master 10/10] Replace with a semantically equivalent chunk.

David Lehman dlehman at redhat.com
Wed Mar 26 14:01:30 UTC 2014


On Tue, 2014-03-25 at 11:49 -0400, mulhern wrote:
> This was motivated by a complaint about unused variable path.
> 
> Signed-off-by: mulhern <amulhern at redhat.com>
> ---
>  blivet/devices.py | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/blivet/devices.py b/blivet/devices.py
> index 50c8dd1..bfca67a 100644
> --- a/blivet/devices.py
> +++ b/blivet/devices.py
> @@ -1310,11 +1310,8 @@ 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:
> +
> +        if not isinstance(partition, parted.Partition):

This is not semantically equivalent. It must be possible to set the
partedPartition to None or a parted.Partition instance.

>              raise ValueError("partition must be a parted.Partition instance")
>  
>          log.debug("device %s new partedPartition %s", self.name, partition)




More information about the anaconda-patches mailing list