Author: gnichols
Date: 2010-03-09 15:14:19 +0000 (Tue, 09 Mar 2010)
New Revision: 437
Modified:
trunk/v7/v7kudzu.py
Log:
571610 - v7-1.1-13 reports no network test in rhel4
Modified: trunk/v7/v7kudzu.py
===================================================================
--- trunk/v7/v7kudzu.py 2010-03-09 14:55:21 UTC (rev 436)
+++ trunk/v7/v7kudzu.py 2010-03-09 15:14:19 UTC (rev 437)
@@ -16,31 +16,30 @@
def __init__(self):
DeviceDetector.__init__(self, name=Constants.kudzu)
- self.hardwareCommand = "/usr/share/rhn/up2date_client/hardware.py"
- self.recordSeparator = "\n" # blank lines separate records - kudzu -p
uses "-\n"
self.devices = None
def isValid(self):
- if not os.path.exists(self.hardwareCommand):
- print "Error: can not determine devices: no command %s" %
self.hardwareCommand
- return False
- # otherwise
- return True
+ return self.devices and len(self.devices) > 0
def getDevices(self):
-
-
- if not self.isValid():
- return list() # empty
-
if self.devices is not None:
return self.devices
# otherwise
self.devices = list()
+ if os.path.exists("/usr/share/rhn/up2date_client/hardware.py"):
+ self.__getDevices("python
/usr/share/rhn/up2date_client/hardware.py", "\n")
+ else:
+ print "Warning: no command
/usr/share/rhn/up2date_client/hardware.py"
+
+ self.__getDevices("kudzu -p", "-\n")
+ return self.devices
+
+ def __getDevices(self, command, recordSeparator):
+ self.hardwareCommand = command
+ self.recordSeparator = recordSeparator
+ pipe = os.popen(self.hardwareCommand)
- pipe = os.popen("python " + self.hardwareCommand)
-
properties = dict()
docWrapper = DocumentWrapper()
while 1:
Show replies by date