Re: [PATCH rhel5-branch] Install and enable openibd service if IPoIB is used (#788871)

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

 



On Wed, Jun 06, 2012 at 01:13:39PM +0200, Radek Vykydal wrote:
> Resolves: rhbz#788871
> ---
>  instdata.py   |    6 ++++++
>  network.py    |   10 ++++++++++
>  yuminstall.py |    2 ++
>  3 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/instdata.py b/instdata.py
> index f6903f3..01108b8 100644
> --- a/instdata.py
> +++ b/instdata.py
> @@ -190,6 +190,12 @@ class InstallData:
>                                         stdout="/dev/tty5", stderr="/dev/tty5",
>                                         root=self.anaconda.rootPath)
>  
> +        if self.network.hasActiveIPoIBDevice():
> +            iutil.execWithRedirect("/sbin/chkconfig",
> +                                   ["openibd", "on"],
> +                                   stdout="/dev/tty5", stderr="/dev/tty5",
> +                                   root=self.anaconda.rootPath)
> +
>          if self.anaconda.isKickstart:
>              for svc in self.ksdata.services["disabled"]:
>                  iutil.execWithRedirect("/sbin/chkconfig",
> diff --git a/network.py b/network.py
> index 4cdc294..b9b5d14 100644
> --- a/network.py
> +++ b/network.py
> @@ -173,6 +173,9 @@ class NetworkDevice(SimpleConfigFile):
>  	elif dev.startswith('iucv'):
>  	    self.info["TYPE"] = "IUCV"
>  
> +    def isIPoIB(self):
> +        return len(self.get('hwaddr')) == 59
> +

This needs some protection from traceback, if hwaddr isn't available
len(None) will blow up. Maybe use this:

return len(self.get('hwaddr', "")) == 59

Also, is this really the best way to check for IPoIB? Seems fragile.

>  class Network:
>      def __init__(self):
>  	self.firstnetdevice = None
> @@ -443,6 +446,13 @@ class Network:
>          return str
>              
>  
> +    def hasActiveIPoIBDevice(self):
> +        for device in self.netdevices.values():
> +            if (device.get("onboot")
> +                and device.isIPoIB()):

This would read nicer if the and was on the same line.

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

Attachment: pgpT_FUHi7dsF.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