Re: [PATCH 6/8] Add dracutSetupData() method to DASDDevice (#526354).

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

 



On 10/10/2009 12:27 AM, David Cantrell wrote:
> Return kernel parameter information for the DASD.
> ---
>  storage/devices.py |   20 ++++++++++++++++++++
>  1 files changed, 20 insertions(+), 0 deletions(-)
> 
> diff --git a/storage/devices.py b/storage/devices.py
> index a37834f..ad936ea 100644
> --- a/storage/devices.py
> +++ b/storage/devices.py
> @@ -3159,6 +3159,26 @@ class DASDDevice(DiskDevice):
>          self.failfast = kwargs.get('failfast')
>          DiskDevice.__init__(self, *args, **kwargs)
> 
> +    def dracutSetupData(self):
> +        arg = {'option': 'dasd', 'combine': True, 'delimiter': ','}
> +        subargs = []
> +
> +        if self.readonly:
> +            subargs.append("ro")

Ah, there you have one more translation.

> +        if self.diag:
> +            subargs.append("diag")
> +        if self.erplog:
> +            subargs.append("erplog")
> +        if self.failfast:
> +            subargs.append("failfast")

Can we store those attributes in a dict in the DASDDevice object?
Using a consistent key naming scheme, we wouldn't need any translation
here and could just generate the subargs with a loop/map-function
without having to explicitly name all possible attributes and having to
possibly extend the code here in the future when other attributes were
added.
Maybe we could even return the internal dict directly without any
conversion whatsoever.

> +
> +        if subargs == []:
> +            arg['value'] = "%s" % (self.busid,)
> +        else:
> +            arg['value'] = "%s(%s)" % (self.busid, ":".join(subargs),)
> +
> +        return [arg]
> +
> 
>  class NFSDevice(StorageDevice, NetworkStorageDevice):
>      """ An NFS device """

Steffen

Linux on System z Development

IBM Deutschland Research & Development GmbH
Vorsitzender des Aufsichtsrats: Martin Jetter
Geschäftsführung: Erich Baier
Sitz der Gesellschaft: Böblingen
Registergericht: Amtsgericht Stuttgart, HRB 243294


_______________________________________________
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