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 06/06/2012 06:54 PM, Brian C. Lane wrote:
On Wed, Jun 06, 2012 at 01:13:39PM +0200, Radek Vykydal wrote:
diff --git a/ b/
index 4cdc294..b9b5d14 100644
--- a/
+++ b/
@@ -173,6 +173,9 @@ class NetworkDevice(SimpleConfigFile):
  	elif dev.startswith('iucv'):["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

Here self is instance of NetworkDevice(SimpleConfigFile) whose get method
always returns string ("" if it doesn't find the key).

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

In rhel 6 we are using libnl to detect type of device in loader
and pass it to stage2 with TYPE in ifcfg files which doesn't fit
into rhel 5 much.
I asked Doug Ledford if using the hwaddr length is ok and
he was not against it, but then I noticed that in rhel6 we are also
reading the type from sysfs which is probably better.
I am sending v.2 of the patch using sysfs.

  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.



Anaconda-devel-list mailing list

[Home]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Red Hat 9 Bible]     [Fedora Bible]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

Powered by Linux