Re: [PATCH 2/2] Make sure new devices' formats have their device attr set.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, May 18, 2011 at 11:29:29AM -0500, David Lehman wrote:
> ---
>  pyanaconda/storage/__init__.py |   12 +++++++++---
>  1 files changed, 9 insertions(+), 3 deletions(-)
> 
> diff --git a/pyanaconda/storage/__init__.py b/pyanaconda/storage/__init__.py
> index 209fbdc..f92c040 100644
> --- a/pyanaconda/storage/__init__.py
> +++ b/pyanaconda/storage/__init__.py
> @@ -820,7 +820,9 @@ class Storage(object):
>          else:
>              name = "req%d" % self.nextID
>  
> -        return PartitionDevice(name, *args, **kwargs)
> +        device = PartitionDevice(name, *args, **kwargs)
> +        device.format.device = device.path
> +        return device
>  
>      def newMDArray(self, *args, **kwargs):
>          """ Return a new MDRaidArrayDevice instance for configuring. """
> @@ -839,7 +841,9 @@ class Storage(object):
>          else:
>              name = "md%d" % kwargs["minor"]
>  
> -        return MDRaidArrayDevice(name, *args, **kwargs)
> +        device = MDRaidArrayDevice(name, *args, **kwargs)
> +        device.format.device = device.path
> +        return device
>  
>      def newVG(self, *args, **kwargs):
>          """ Return a new LVMVolumeGroupDevice instance. """
> @@ -885,7 +889,9 @@ class Storage(object):
>          if name in [d.name for d in self.devices]:
>              raise ValueError("name already in use")
>  
> -        return LVMLogicalVolumeDevice(name, vg, *args, **kwargs)
> +        device = LVMLogicalVolumeDevice(name, vg, *args, **kwargs)
> +        device.format.device = device.path
> +        return device
>  
>      def createDevice(self, device):
>          """ Schedule creation of a device.
> -- 
> 1.7.3.4

If this attribute is something that is going to need to be setup every
time the class is used it should be done in the __init__ and not
something the caller needs to know how to setup.


-- 
Brian C. Lane | Anaconda Team | IRC: bcl #anaconda | Port Orchard, WA (PST8PDT)

Attachment: pgpLChdHP44kN.pgp
Description: PGP signature

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux