client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py | 12 +++++-----
1 file changed, 6 insertions(+), 6 deletions(-)
New commits:
commit 013ee43afa07cd7f8b1441e111c98439bd659b1c
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue May 25 13:41:22 2010 +0200
595669 - fix regexp and do not fail if regexp do not match
addressing:
Traceback (most recent call last):
File "/usr/sbin/rhnreg_ks", line 205, in <module>
cli.run()
File "/usr/share/rhn/up2date_client/rhncli.py", line 74, in run
sys.exit(self.main() or 0)
File "/usr/sbin/rhnreg_ks", line 99, in main
hardwareList = hardware.Hardware()
File "/usr/share/rhn/up2date_client/hardware.py", line 667, in Hardware
allhw = get_devices()
File "/usr/share/rhn/up2date_client/hardware_gudev.py", line 93, in
get_devices
result_item['prop1'] = m.group(1) # DEV_HOST
<type 'exceptions.AttributeError'>: 'NoneType' object has no
attribute 'group'
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
b/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
index b0dcde3..f2cdd37 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
@@ -85,14 +85,15 @@ def get_devices():
if device.has_property('ID_PATH') or
device.has_property('DEVPATH'):
if device.has_property('ID_PATH'):
path = device.get_property('ID_PATH')
- m = re.search('.*-scsi-(\d+):(\d+):(\d+):(\d+)', path)
+ m = re.search('.*scsi-(\d+):(\d+):(\d+):(\d+)', path)
else: # device.has_property('DEVPATH')
path = device.get_property('DEVPATH')
m = re.search('.*/(\d+):(\d+):(\d+):(\d+)/block/', path)
- result_item['prop1'] = m.group(1) # DEV_HOST
- result_item['prop2'] = m.group(2) # DEV_ID
- result_item['prop3'] = m.group(3) # DEV_CHANNEL
- result_item['prop4'] = m.group(4) # DEV_LUN
+ if m: # do not fail, if regexp did not match
+ result_item['prop1'] = m.group(1) # DEV_HOST
+ result_item['prop2'] = m.group(2) # DEV_ID
+ result_item['prop3'] = m.group(3) # DEV_CHANNEL
+ result_item['prop4'] = m.group(4) # DEV_LUN
result.append(result_item)
return result
commit 43aff12fd21ff355a52dba7a7dd5ece84363a916
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Tue May 25 13:32:49 2010 +0200
whitespace cleanup
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
b/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
index cf08a0a..b0dcde3 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py
@@ -28,7 +28,6 @@ def get_devices():
'detached' : '0'
'class' : 'OTHER'
'desc' : 'Intel Corporation|5000 Series Chipset PCI Express x4 Port
2'
-
"""
# listen to uevents on all subsystems
client = gudev.Client([""])
Show replies by date