java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java | 13 ++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
New commits:
commit 69b9b47e4a71fcca2e52e5b0c1c52bc1266b6770
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Mon Mar 22 17:59:59 2010 +0100
test case fix for SystemHandlerTest
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java
index e986b50..a6cdc33 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java
@@ -1040,10 +1040,15 @@ public class SystemHandlerTest extends BaseHandlerTestCase {
assertEquals(server.getName(), (String)name.get("name"));
assertNotNull(name.get("last_checkin"));
- Map invalid = handler.getName(adminKey, 10001234);
- assertTrue(null != invalid);
- assertNull(invalid.get("id"));
- assertNull(invalid.get("name"));
+ try {
+ Map invalid = handler.getName(adminKey, 10001234);
+ assertTrue(null != invalid);
+ assertNull(invalid.get("id"));
+ assertNull(invalid.get("name"));
+ }
+ catch (NoSuchSystemException e) {
+ // expected
+ }
}
public void testGetRegistrationDate() throws Exception {
14 years, 3 months
Changes to 'refs/tags/rhn-client-tools-0.9.5-1'
by Miroslav Suchý
Tag 'rhn-client-tools-0.9.5-1' created by Miroslav Suchý <msuchy(a)redhat.com> at 2010-03-22 14:07 +0000
Tagging package [rhn-client-tools] version [0.9.5-1] in directory [client/rhel/rhn-client-tools/].
Changes since spacewalk-java-0.9.10-1:
Miroslav Suchý (14):
fixing import of module
564352 - refactor function so it could not return None
564352 - cache devices across all classes
564352 - hexa numbers in pci.ids are in lower case
564352 - detect sound subsystems as AUDIO and provide vendor string in desc
564352 - add leading zero to subclasses as it is parsed from bigger string
564352 - create hwdata.USB class to parse usb.ids
require python-haslib only in rhel5
do not start osad by default
564352 - add USB class
564352 - replace external call of lsusb with usage of USB class
564352 - if network device is properly classified it will not shown on HW tab in webUI, set it to OTHER for now
564352 - set descriptions for usb interfaces
Automatic commit of package [rhn-client-tools] release [0.9.5-1].
---
client/rhel/rhn-client-tools/rhn-client-tools.spec | 6
client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py | 114 +++++-----
client/rhel/rhn-client-tools/src/up2date_client/hwdata.py | 108 ++++++++-
client/tools/osad/osad.spec | 2
client/tools/osad/prog.init | 3
rel-eng/packages/rhn-client-tools | 2
6 files changed, 163 insertions(+), 72 deletions(-)
---
14 years, 3 months
client/rhel rel-eng/packages
by Miroslav Suchý
client/rhel/rhn-client-tools/rhn-client-tools.spec | 5 ++++-
rel-eng/packages/rhn-client-tools | 2 +-
2 files changed, 5 insertions(+), 2 deletions(-)
New commits:
commit 7fc3cb75d16d5df6b1062baff3110a2bd97d4e86
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 22 15:07:24 2010 +0100
Automatic commit of package [rhn-client-tools] release [0.9.5-1].
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index ec0f153..84a062e 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -4,7 +4,7 @@ Group: System Environment/Base
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
URL: https://fedorahosted.org/spacewalk
Name: rhn-client-tools
-Version: 0.9.4
+Version: 0.9.5
Release: 1%{?dist}
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch: noarch
@@ -240,6 +240,9 @@ make -f Makefile.rhn-client-tools test
%{_datadir}/applications/rhn_register.desktop
%changelog
+* Mon Mar 22 2010 Miroslav Suchy <msuchy(a)redhat.com> 0.9.5-1
+- 564352 - use gudev instead of hal if gudev is present
+
* Mon Mar 01 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.9.4-1
- added new CA key valid until 2020
- 567901 - fix input of user name
diff --git a/rel-eng/packages/rhn-client-tools b/rel-eng/packages/rhn-client-tools
index 5118efd..6043843 100644
--- a/rel-eng/packages/rhn-client-tools
+++ b/rel-eng/packages/rhn-client-tools
@@ -1 +1 @@
-0.9.4-1 client/rhel/rhn-client-tools/
+0.9.5-1 client/rhel/rhn-client-tools/
14 years, 3 months
13 commits - client/rhel client/tools
by Miroslav Suchý
client/rhel/rhn-client-tools/rhn-client-tools.spec | 1
client/rhel/rhn-client-tools/src/up2date_client/hardware_gudev.py | 114 +++++-----
client/rhel/rhn-client-tools/src/up2date_client/hwdata.py | 108 ++++++++-
client/tools/osad/osad.spec | 2
client/tools/osad/prog.init | 3
5 files changed, 158 insertions(+), 70 deletions(-)
New commits:
commit 2e0a87cd2a120b7408315b6d5e63ff35e9417d6a
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 22 15:02:21 2010 +0100
564352 - set descriptions for usb interfaces
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 b9e2e7c..dfccbce 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
@@ -261,6 +261,13 @@ def _get_device_desc(device):
if vendor_id:
usb = USB()
result = usb.get_vendor(vendor_id) + '|' + usb.get_device(vendor_id, device.get_property('ID_MODEL_ID'))
+ elif device.get_devtype() == 'usb_interface':
+ if device.get_driver() == 'usbhid':
+ result = 'USB HID Interface'
+ elif device.get_driver() == 'hub':
+ result = 'USB Hub Interface'
+ else:
+ result = 'USB Interface'
elif subsystem == 'block':
result = device.get_property('ID_MODEL')
if result:
commit 4ab3fec4b71da6c73c4682228aba473ec6d20477
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 22 13:46:07 2010 +0100
564352 - if network device is properly classified it will not shown on HW tab in webUI, set it to OTHER for now
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 84927c9..b9e2e7c 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
@@ -181,7 +181,7 @@ def _clasify_class(device):
# network devices
if base_class == PCI_BASE_CLASS_NETWORK:
- return 'NETWORK'
+ return 'OTHER' # if set as 'NETWORK' it will not display in HW tab
# input devices
# pci
commit f308b5c39821edeff202808f8c3fb89a5e183d53
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 22 13:30:42 2010 +0100
564352 - replace external call of lsusb with usage of USB class
diff --git a/client/rhel/rhn-client-tools/rhn-client-tools.spec b/client/rhel/rhn-client-tools/rhn-client-tools.spec
index ee86f42..ec0f153 100644
--- a/client/rhel/rhn-client-tools/rhn-client-tools.spec
+++ b/client/rhel/rhn-client-tools/rhn-client-tools.spec
@@ -21,7 +21,6 @@ Requires: sh-utils
Requires: dbus-python
%if 0%{?fedora} > 12 || 0%{?rhel} > 5
Requires: python-gudev
-Requires: usbutils
Requires: hwdata
%else
Requires: hal >= 0.5.8.1-52
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 6b2a32b..84927c9 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
@@ -17,7 +17,7 @@ import glib
import os
import re
-from hwdata import PCI
+from hwdata import PCI, USB
def get_devices():
""" Returns list of dictionaries with keys for every device in system
@@ -257,10 +257,10 @@ def _get_device_desc(device):
pci = PCI()
result = pci.get_vendor(vendor_id) + '|' + pci.get_device(vendor_id, device_id)
elif subsystem == 'usb':
- command = "lsusb -d %s:%s" % ( device.get_property('ID_VENDOR_ID'),
- device.get_property('ID_MODEL_ID') )
- from subprocess import PIPE, Popen
- result = Popen(command, stdout=PIPE, shell=True).stdout.read()
+ vendor_id = device.get_property('ID_VENDOR_ID')
+ if vendor_id:
+ usb = USB()
+ result = usb.get_vendor(vendor_id) + '|' + usb.get_device(vendor_id, device.get_property('ID_MODEL_ID'))
elif subsystem == 'block':
result = device.get_property('ID_MODEL')
if result:
commit d7997108763bf8ac221a0b089407646e5e836f17
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Mon Mar 22 11:57:44 2010 +0100
564352 - add USB class
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py b/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
index 2929535..0dd8c38 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
@@ -27,19 +27,19 @@ class USB:
if filename:
self.filename = filename
else:
- self.filename = PCI.filename
+ self.filename = USB.filename
self.cache = 1
if self.cache and not USB.devices:
# parse usb.ids
- usbrec = {}
USB.devices = {}
for line in open(self.filename).readlines():
l = line.split()
if line.startswith('#'):
- continue
- elif line.starswith('# List of known device classes, subclasses and protocols'):
- break # end of database of devices, rest is protocols, types etc.
+ if line.startswith('# List of known device classes, subclasses and protocols'):
+ break # end of database of devices, rest is protocols, types etc.
+ else:
+ continue
elif len(l) == 0:
continue
elif line.startswith('\t\t'):
@@ -83,7 +83,7 @@ class USB:
if self.cache:
if USB.devices.has_key(vendor):
if USB.devices[vendor][1].has_key(device):
- return USB.devices[vendor][1][device]
+ return USB.devices[vendor][1][device][0]
else:
return None
else:
commit 2f969a014f6299a32f52223ee283a906ee220ed2
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Sun Mar 21 14:13:18 2010 +0100
do not start osad by default
addresing rpmlint warning osad.noarch: W: service-default-enabled /etc/rc.d/init.d/osad
diff --git a/client/tools/osad/prog.init b/client/tools/osad/prog.init
index 9319791..a214e2c 100755
--- a/client/tools/osad/prog.init
+++ b/client/tools/osad/prog.init
@@ -2,14 +2,13 @@
#
# @@PROG@@ This shell script starts the @@PROG@@ daemon
#
-# chkconfig: 2345 81 04
+# chkconfig: - 81 04
# description: @@PROG@@ is a daemon used by the Spacewalk
#
### BEGIN INIT INFO
# Provides: @@PROG@@
# Required-Start: $local_fs $network
# Required-Stop: $local_fs $network
-# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: This shell script starts the @@PROG@@ daemon
# Description: @@PROG@@ is a daemon used by the Spacewalk
commit e2cf44a2af48f5c76d6240a1dee0e6a789c9c1dc
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Sun Mar 21 14:03:24 2010 +0100
require python-haslib only in rhel5
addressing rpmlint errror:
osad.noarch: E: explicit-lib-dependency python-hashlib
diff --git a/client/tools/osad/osad.spec b/client/tools/osad/osad.spec
index eb47063..cef9a37 100644
--- a/client/tools/osad/osad.spec
+++ b/client/tools/osad/osad.spec
@@ -17,7 +17,9 @@ BuildRequires: python-devel
Requires: python
Requires: rhnlib >= 1.8-3
Requires: jabberpy
+%if 0%{?rhel} <= 5
Requires: python-hashlib
+%endif
# This should have been required by rhnlib
Requires: PyXML
%if "%{pythongen}" == "1.5"
commit c3ee1aa85c631dfce29dbb0009f832a25b01b6fc
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Fri Mar 19 16:39:59 2010 +0100
564352 - create hwdata.USB class to parse usb.ids
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py b/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
index ede39e3..2929535 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
@@ -15,6 +15,82 @@
""" Query hwdata database and return decription of vendor and/or device. """
+class USB:
+ """ Interace to usb.ids from hwdata package """
+ filename = '/usr/share/hwdata/usb.ids'
+ devices = None
+
+ def __init__(self, filename=None):
+ """ Load pci.ids from file to internal data structure.
+ parameter 'filename' can specify location of this file
+ """
+ if filename:
+ self.filename = filename
+ else:
+ self.filename = PCI.filename
+ self.cache = 1
+
+ if self.cache and not USB.devices:
+ # parse usb.ids
+ usbrec = {}
+ USB.devices = {}
+ for line in open(self.filename).readlines():
+ l = line.split()
+ if line.startswith('#'):
+ continue
+ elif line.starswith('# List of known device classes, subclasses and protocols'):
+ break # end of database of devices, rest is protocols, types etc.
+ elif len(l) == 0:
+ continue
+ elif line.startswith('\t\t'):
+ interface_id = l[0].lower()
+ if len(l) > 2:
+ interface_name = ' '.join(l[1:])
+ else:
+ interface_name = ''
+ USB.devices[vendor][1][device][0][interface_id] = interface_name
+ elif line.startswith('\t'):
+ device = l[0].lower()
+ device_name = ' '.join(l[1:])
+ USB.devices[vendor][1][device] = [device_name, {}]
+ else:
+ vendor = l[0].lower()
+ vendor_name = ' '.join(l[1:])
+ if not USB.devices.has_key(vendor):
+ USB.devices[vendor] = [vendor_name, {}]
+ else: # this should not happen
+ USB.devices[vendor][0] = vendor_name
+
+ def get_vendor(self, vendor):
+ """ Return description of vendor. Parameter is two byte code in hexa.
+ If vendor is unknown None is returned.
+ """
+ vendor = vendor.lower()
+ if self.cache:
+ if USB.devices.has_key(vendor):
+ return USB.devices[vendor][0]
+ else:
+ return None
+ else:
+ raise # not implemented yet
+
+ def get_device(self, vendor, device):
+ """ Return description of device. Parameters are two byte code variables in hexa.
+ If device is unknown None is returned.
+ """
+ vendor = vendor.lower()
+ device = device.lower()
+ if self.cache:
+ if USB.devices.has_key(vendor):
+ if USB.devices[vendor][1].has_key(device):
+ return USB.devices[vendor][1][device]
+ else:
+ return None
+ else:
+ return None
+ else:
+ raise # not implemented yet
+
class PCI:
""" Interace to pci.ids from hwdata package """
filename = '/usr/share/hwdata/pci.ids'
commit 97c9fa7dfab51877548efbd53ed5b9580101932d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Mar 18 17:37:04 2010 +0100
564352 - add leading zero to subclasses as it is parsed from bigger string
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 25b709a..6b2a32b 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
@@ -102,66 +102,66 @@ def get_computer_info():
# These are taken from pci_ids.h in the linux kernel source and used to
# properly identify the hardware
PCI_BASE_CLASS_STORAGE = '1'
-PCI_CLASS_STORAGE_SCSI = '0'
-PCI_CLASS_STORAGE_IDE = '1'
-PCI_CLASS_STORAGE_FLOPPY = '2'
-PCI_CLASS_STORAGE_IPI = '3'
-PCI_CLASS_STORAGE_RAID = '4'
+PCI_CLASS_STORAGE_SCSI = '00'
+PCI_CLASS_STORAGE_IDE = '01'
+PCI_CLASS_STORAGE_FLOPPY = '02'
+PCI_CLASS_STORAGE_IPI = '03'
+PCI_CLASS_STORAGE_RAID = '04'
PCI_CLASS_STORAGE_OTHER = '80'
PCI_BASE_CLASS_NETWORK = '2'
-PCI_CLASS_NETWORK_ETHERNET = '0'
-PCI_CLASS_NETWORK_TOKEN_RING = '1'
-PCI_CLASS_NETWORK_FDDI = '2'
-PCI_CLASS_NETWORK_ATM = '3'
+PCI_CLASS_NETWORK_ETHERNET = '00'
+PCI_CLASS_NETWORK_TOKEN_RING = '01'
+PCI_CLASS_NETWORK_FDDI = '02'
+PCI_CLASS_NETWORK_ATM = '03'
PCI_CLASS_NETWORK_OTHER = '80'
PCI_BASE_CLASS_DISPLAY = '3'
-PCI_CLASS_DISPLAY_VGA = '0'
-PCI_CLASS_DISPLAY_XGA = '1'
-PCI_CLASS_DISPLAY_3D = '2'
+PCI_CLASS_DISPLAY_VGA = '00'
+PCI_CLASS_DISPLAY_XGA = '01'
+PCI_CLASS_DISPLAY_3D = '02'
PCI_CLASS_DISPLAY_OTHER = '80'
PCI_BASE_CLASS_MULTIMEDIA = '4'
-PCI_CLASS_MULTIMEDIA_VIDEO = '0'
-PCI_CLASS_MULTIMEDIA_AUDIO = '1'
-PCI_CLASS_MULTIMEDIA_PHONE = '2'
+PCI_CLASS_MULTIMEDIA_VIDEO = '00'
+PCI_CLASS_MULTIMEDIA_AUDIO = '01'
+PCI_CLASS_MULTIMEDIA_PHONE = '02'
PCI_CLASS_MULTIMEDIA_OTHER = '80'
PCI_BASE_CLASS_BRIDGE = '6'
-PCI_CLASS_BRIDGE_HOST = '0'
-PCI_CLASS_BRIDGE_ISA = '1'
-PCI_CLASS_BRIDGE_EISA = '2'
-PCI_CLASS_BRIDGE_MC = '3'
-PCI_CLASS_BRIDGE_PCI = '4'
-PCI_CLASS_BRIDGE_PCMCIA = '5'
-PCI_CLASS_BRIDGE_NUBUS = '6'
-PCI_CLASS_BRIDGE_CARDBUS = '7'
-PCI_CLASS_BRIDGE_RACEWAY = '8'
+PCI_CLASS_BRIDGE_HOST = '00'
+PCI_CLASS_BRIDGE_ISA = '01'
+PCI_CLASS_BRIDGE_EISA = '02'
+PCI_CLASS_BRIDGE_MC = '03'
+PCI_CLASS_BRIDGE_PCI = '04'
+PCI_CLASS_BRIDGE_PCMCIA = '05'
+PCI_CLASS_BRIDGE_NUBUS = '06'
+PCI_CLASS_BRIDGE_CARDBUS = '07'
+PCI_CLASS_BRIDGE_RACEWAY = '08'
PCI_CLASS_BRIDGE_OTHER = '80'
PCI_BASE_CLASS_COMMUNICATION = '7'
-PCI_CLASS_COMMUNICATION_SERIAL = '0'
-PCI_CLASS_COMMUNICATION_PARALLEL = '1'
-PCI_CLASS_COMMUNICATION_MULTISERIAL = '2'
-PCI_CLASS_COMMUNICATION_MODEM = '3'
+PCI_CLASS_COMMUNICATION_SERIAL = '00'
+PCI_CLASS_COMMUNICATION_PARALLEL = '01'
+PCI_CLASS_COMMUNICATION_MULTISERIAL = '02'
+PCI_CLASS_COMMUNICATION_MODEM = '03'
PCI_CLASS_COMMUNICATION_OTHER = '80'
PCI_BASE_CLASS_INPUT = '9'
-PCI_CLASS_INPUT_KEYBOARD = '0'
-PCI_CLASS_INPUT_PEN = '1'
-PCI_CLASS_INPUT_MOUSE = '2'
-PCI_CLASS_INPUT_SCANNER = '3'
-PCI_CLASS_INPUT_GAMEPORT = '4'
+PCI_CLASS_INPUT_KEYBOARD = '00'
+PCI_CLASS_INPUT_PEN = '01'
+PCI_CLASS_INPUT_MOUSE = '02'
+PCI_CLASS_INPUT_SCANNER = '03'
+PCI_CLASS_INPUT_GAMEPORT = '04'
PCI_CLASS_INPUT_OTHER = '80'
-PCI_BASE_CLASS_SERIAL = '0C'
-PCI_CLASS_SERIAL_FIREWIRE = '0'
-PCI_CLASS_SERIAL_ACCESS = '1'
-PCI_CLASS_SERIAL_SSA = '2'
-PCI_CLASS_SERIAL_USB = '3'
-PCI_CLASS_SERIAL_FIBER = '4'
-PCI_CLASS_SERIAL_SMBUS = '5'
+PCI_BASE_CLASS_SERIAL = 'C'
+PCI_CLASS_SERIAL_FIREWIRE = '00'
+PCI_CLASS_SERIAL_ACCESS = '01'
+PCI_CLASS_SERIAL_SSA = '02'
+PCI_CLASS_SERIAL_USB = '03'
+PCI_CLASS_SERIAL_FIBER = '04'
+PCI_CLASS_SERIAL_SMBUS = '05'
def _clasify_pci_type(subsystem):
""" return 1 if device is PCI, otherwise -1 """
commit 0d798f81a33fbc8ee86772a805c918cd80eab111
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Mar 18 17:19:58 2010 +0100
564352 - detect sound subsystems as AUDIO and provide vendor string in desc
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 3e0f52d..25b709a 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
@@ -234,6 +234,8 @@ def _clasify_class(device):
return 'CDROM'
else:
return 'HD' #FIXME had to distinguis HD, FLOPY, TAPE and flash disks
+ elif subsystem == 'sound':
+ return 'AUDIO'
# PRINTER
pass #FIXME
@@ -253,7 +255,7 @@ def _get_device_desc(device):
if subsystem == 'pci':
(vendor_id, device_id) = device.get_property('PCI_ID').split(':')
pci = PCI()
- result = pci.get_device(vendor_id, device_id)
+ result = pci.get_vendor(vendor_id) + '|' + pci.get_device(vendor_id, device_id)
elif subsystem == 'usb':
command = "lsusb -d %s:%s" % ( device.get_property('ID_VENDOR_ID'),
device.get_property('ID_MODEL_ID') )
commit da63783eb8d87832815286a6b4a4f21f8dcbbdb3
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Mar 18 17:03:37 2010 +0100
564352 - hexa numbers in pci.ids are in lower case
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py b/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
index 09eaacd..ede39e3 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
@@ -70,6 +70,7 @@ class PCI:
""" Return description of vendor. Parameter is two byte code in hexa.
If vendor is unknown None is returned.
"""
+ vendor = vendor.lower()
if self.cache:
if PCI.devices.has_key(vendor):
return PCI.devices[vendor][0]
@@ -82,6 +83,8 @@ class PCI:
""" Return description of device. Parameters are two byte code variables in hexa.
If device is unknown None is returned.
"""
+ vendor = vendor.lower()
+ device = device.lower()
if self.cache:
if PCI.devices.has_key(vendor):
if PCI.devices[vendor][1].has_key(device):
commit bd16fcaed304ae5421146317802138b54e8fc602
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Mar 18 16:44:25 2010 +0100
564352 - cache devices across all classes
make device variable of class and not just instance attribute
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py b/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
index 6612ab8..09eaacd 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hwdata.py
@@ -18,6 +18,7 @@
class PCI:
""" Interace to pci.ids from hwdata package """
filename = '/usr/share/hwdata/pci.ids'
+ devices = None
def __init__(self, filename=None):
""" Load pci.ids from file to internal data structure.
@@ -29,10 +30,10 @@ class PCI:
self.filename = PCI.filename
self.cache = 1
- if self.cache:
+ if self.cache and not PCI.devices:
# parse pci.ids
pcirec = {}
- self.devices = {}
+ PCI.devices = {}
for line in open(self.filename).readlines():
l = line.split()
if line.startswith('#'):
@@ -49,29 +50,29 @@ class PCI:
subsystem_name = ' '.join(l[2:])
else:
subsystem_name = ''
- if not self.devices.has_key(subvendor):
- self.devices[subvendor] = [vendor_name, {subdevice: subsystem_name}]
+ if not PCI.devices.has_key(subvendor):
+ PCI.devices[subvendor] = [vendor_name, {subdevice: subsystem_name}]
else: # this should not happen
- self.devices[subvendor][1][subdevice] = subsystem_name
+ PCI.devices[subvendor][1][subdevice] = subsystem_name
elif line.startswith('\t'):
device = l[0].lower()
device_name = ' '.join(l[1:])
- self.devices[vendor][1][device] = device_name
+ PCI.devices[vendor][1][device] = device_name
else:
vendor = l[0].lower()
vendor_name = ' '.join(l[1:])
- if not self.devices.has_key(vendor):
- self.devices[vendor] = [vendor_name, {}]
+ if not PCI.devices.has_key(vendor):
+ PCI.devices[vendor] = [vendor_name, {}]
else: # this should not happen
- self.devices[vendor][0] = vendor_name
+ PCI.devices[vendor][0] = vendor_name
def get_vendor(self, vendor):
""" Return description of vendor. Parameter is two byte code in hexa.
If vendor is unknown None is returned.
"""
if self.cache:
- if self.devices.has_key(vendor):
- return self.devices[vendor][0]
+ if PCI.devices.has_key(vendor):
+ return PCI.devices[vendor][0]
else:
return None
else:
@@ -82,9 +83,9 @@ class PCI:
If device is unknown None is returned.
"""
if self.cache:
- if self.devices.has_key(vendor):
- if self.devices[vendor][1].has_key(device):
- return self.devices[vendor][1][device]
+ if PCI.devices.has_key(vendor):
+ if PCI.devices[vendor][1].has_key(device):
+ return PCI.devices[vendor][1][device]
else:
return None
else:
commit 6949426d743954b3e259b280f1ced75dd8c6c48d
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Mar 18 16:25:32 2010 +0100
564352 - refactor function so it could not return None
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 ba2ed12..3e0f52d 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
@@ -249,22 +249,20 @@ def _get_device_desc(device):
""" Return human readable description of device. """
subsystem = device.get_subsystem()
command = None
+ result = None
if subsystem == 'pci':
(vendor_id, device_id) = device.get_property('PCI_ID').split(':')
pci = PCI()
- return pci.get_device(vendor_id, device_id)
- #command = "lspci -d %s" % device.get_property('PCI_ID')
+ result = pci.get_device(vendor_id, device_id)
elif subsystem == 'usb':
command = "lsusb -d %s:%s" % ( device.get_property('ID_VENDOR_ID'),
device.get_property('ID_MODEL_ID') )
+ from subprocess import PIPE, Popen
+ result = Popen(command, stdout=PIPE, shell=True).stdout.read()
elif subsystem == 'block':
- desc = device.get_property('ID_MODEL')
- if desc is None:
- desc = ''
- return desc
- from subprocess import PIPE, Popen
- if command:
- return Popen(command, stdout=PIPE, shell=True).stdout.read()
+ result = device.get_property('ID_MODEL')
+ if result:
+ return result
else:
return ''
commit 288516a100dd06f34f123cd3a7feae159168893c
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Thu Mar 18 16:20:44 2010 +0100
fixing import of module
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 5ffa5cb..ba2ed12 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
@@ -16,7 +16,8 @@ import gudev
import glib
import os
import re
-import hwdata
+
+from hwdata import PCI
def get_devices():
""" Returns list of dictionaries with keys for every device in system
14 years, 3 months
Changes to 'refs/tags/spacewalk-java-0.9.10-1'
by Tomas Lestach
Tag 'spacewalk-java-0.9.10-1' created by Tomas Lestach <tlestach(a)redhat.com> at 2010-03-22 13:57 +0000
Tagging package [spacewalk-java] version [0.9.10-1] in directory [java/].
Changes since spacewalk-backend-0.9.12-1:
Tomas Lestach (2):
575796 - make system.get_name API call faster
Automatic commit of package [spacewalk-java] release [0.9.10-1].
---
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 31 ++++------
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java | 14 ++--
java/spacewalk-java.spec | 10 ++-
rel-eng/packages/spacewalk-java | 2
4 files changed, 32 insertions(+), 25 deletions(-)
---
14 years, 3 months
java/spacewalk-java.spec rel-eng/packages
by Tomas Lestach
java/spacewalk-java.spec | 10 +++++++++-
rel-eng/packages/spacewalk-java | 2 +-
2 files changed, 10 insertions(+), 2 deletions(-)
New commits:
commit 3e431d2817cb018bd2eb878700a877ab6c0c9fe1
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Mon Mar 22 14:57:49 2010 +0100
Automatic commit of package [spacewalk-java] release [0.9.10-1].
diff --git a/java/spacewalk-java.spec b/java/spacewalk-java.spec
index 95cb03b..98c4ac7 100644
--- a/java/spacewalk-java.spec
+++ b/java/spacewalk-java.spec
@@ -19,7 +19,7 @@ Name: spacewalk-java
Summary: Spacewalk Java site packages
Group: Applications/Internet
License: GPLv2
-Version: 0.9.9
+Version: 0.9.10
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -308,6 +308,14 @@ fi
%{jardir}/postgresql-jdbc.jar
%changelog
+* Mon Mar 22 2010 Tomas Lestach <tlestach(a)redhat.com> 0.9.10-1
+- 575796 - make system.get_name API call faster (tlestach(a)redhat.com)
+- 529359 - attempting to fix issue where solaris packages couldnt be installed,
+ may break unit test, we will see (jsherril(a)redhat.com)
+- 529359 - Fix for this error (paji(a)redhat.com)
+- Basically removed the listAllSystems call in SystemManager (paji(a)redhat.com)
+- 574197 - making cobbler name seperator configurable (jsherril(a)redhat.com)
+
* Wed Mar 17 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.9.9-1
- 568958 - package removal and verify
- 516048 - syncing java stack with perl stack on channel naming convention
diff --git a/rel-eng/packages/spacewalk-java b/rel-eng/packages/spacewalk-java
index 3ea7e27..1083e55 100644
--- a/rel-eng/packages/spacewalk-java
+++ b/rel-eng/packages/spacewalk-java
@@ -1 +1 @@
-0.9.9-1 java/
+0.9.10-1 java/
14 years, 3 months
java/code
by Tomas Lestach
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java | 31 ++++------
java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java | 14 ++--
2 files changed, 22 insertions(+), 23 deletions(-)
New commits:
commit fa743bdce5b02aeed0b0a0d52b0fe0a1fbb6433a
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Mon Mar 22 14:42:07 2010 +0100
575796 - make system.get_name API call faster
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
index 41f78b4..cdb75ed 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/SystemHandler.java
@@ -2188,28 +2188,27 @@ public class SystemHandler extends BaseHandler {
* Get system name and last check in information for the given system ID.
* @param sessionKey of user making call
* @param serverId of the server
- * @return Object[] Integer Array containing system Ids with the given name
+ * @return Map containing server id, name and last checkin date
*
* @xmlrpc.doc Get system name and last check in information for the given system ID.
* @xmlrpc.param #param("string", "sessionKey")
- * @xmlrpc.param #param("string", "serverId")
+ * @xmlrpc.param #param("string", "serverId")
* @xmlrpc.returntype
- * $SystemOverviewSerializer
+ * #struct("name info")
+ * #prop_desc("int", "id", "Server id")
+ * #prop_desc("string", "name", "Server name")
+ * #prop_desc("dateTime.iso8601", "last_checkin", "Last time server
+ * successfully checked in")
+ * #struct_end()
*/
- public SystemOverview getName(String sessionKey, Integer serverId) {
-
+ public Map getName(String sessionKey, Integer serverId) {
User loggedInUser = getLoggedInUser(sessionKey);
- List<SystemOverview> dr = UserManager.visibleSystemsAsDto(loggedInUser);
- SystemOverview result = new SystemOverview();
-
- for (SystemOverview system : dr) {
- if (system.getId().equals(new Long(serverId))) {
- result = system;
- // we can stop searching since server ids are unique
- break;
- }
- }
- return result;
+ Server server = lookupServer(loggedInUser, serverId);
+ Map name = new HashMap();
+ name.put("id", server.getId());
+ name.put("name", server.getName());
+ name.put("last_checkin", server.getLastCheckin());
+ return name;
}
/**
diff --git a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java
index dc43dce..e986b50 100644
--- a/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java
+++ b/java/code/src/com/redhat/rhn/frontend/xmlrpc/system/test/SystemHandlerTest.java
@@ -1033,17 +1033,17 @@ public class SystemHandlerTest extends BaseHandlerTestCase {
public void testGetName() throws Exception {
Server server = ServerFactoryTest.createTestServer(admin, true);
- SystemOverview name = handler.getName(adminKey, server.getId().intValue());
+ Map name = handler.getName(adminKey, server.getId().intValue());
assertTrue(null != name);
- assertEquals(server.getId(), (Long)name.getId());
- assertEquals(server.getName(), (String)name.getName());
- assertNotNull(name.getLastCheckin());
+ assertEquals(server.getId(), (Long)name.get("id"));
+ assertEquals(server.getName(), (String)name.get("name"));
+ assertNotNull(name.get("last_checkin"));
- SystemOverview invalid = handler.getName(adminKey, 10001234);
+ Map invalid = handler.getName(adminKey, 10001234);
assertTrue(null != invalid);
- assertNull(invalid.getId());
- assertNull(invalid.getName());
+ assertNull(invalid.get("id"));
+ assertNull(invalid.get("name"));
}
public void testGetRegistrationDate() throws Exception {
14 years, 3 months
Changes to 'refs/tags/spacewalk-backend-0.9.12-1'
by Michael Mraka
Tag 'spacewalk-backend-0.9.12-1' created by Michael Mraka <michael.mraka(a)redhat.com> at 2010-03-22 09:30 +0000
Tagging package [spacewalk-backend] version [0.9.12-1] in directory [backend/].
Changes since rhnsd-4.9.3-1:
Justin Sherrill (1):
529359 - attempting to fix issue where solaris packages couldnt be installed, may break unit test, we will see
Michael Mraka (2):
571413 - added missing sha256 src rpms code
Automatic commit of package [spacewalk-backend] release [0.9.12-1].
Milan Zazrivec (1):
575259 - properly set protocol type
Partha Aji (1):
Fixed an annoying checkstyle error
---
backend/server/importlib/headerSource.py | 9 +++---
backend/server/importlib/importLib.py | 5 ++-
backend/server/importlib/packageImport.py | 14 ++++++++++
backend/spacewalk-backend.spec | 6 +++-
client/rhel/rhnlib/rhn/rpclib.py | 2 -
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ScheduleRemoteCommand.java | 2 -
java/code/src/com/redhat/rhn/manager/action/ActionManager.java | 2 -
rel-eng/packages/spacewalk-backend | 2 -
8 files changed, 31 insertions(+), 11 deletions(-)
---
14 years, 3 months
2 commits - backend/server backend/spacewalk-backend.spec rel-eng/packages
by Michael Mraka
backend/server/importlib/headerSource.py | 9 +++++----
backend/server/importlib/importLib.py | 5 +++--
backend/server/importlib/packageImport.py | 14 ++++++++++++++
backend/spacewalk-backend.spec | 6 +++++-
rel-eng/packages/spacewalk-backend | 2 +-
5 files changed, 28 insertions(+), 8 deletions(-)
New commits:
commit 38a50666e1be8f0a941544a2ed3ada2783c8146f
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Mar 22 10:30:01 2010 +0100
Automatic commit of package [spacewalk-backend] release [0.9.12-1].
diff --git a/backend/spacewalk-backend.spec b/backend/spacewalk-backend.spec
index 6d332ed..454a3d4 100644
--- a/backend/spacewalk-backend.spec
+++ b/backend/spacewalk-backend.spec
@@ -8,7 +8,7 @@ Name: spacewalk-backend
Summary: Common programs needed to be installed on the Spacewalk servers/proxies
Group: Applications/Internet
License: GPLv2
-Version: 0.9.11
+Version: 0.9.12
Release: 1%{?dist}
URL: https://fedorahosted.org/spacewalk
Source0: https://fedorahosted.org/releases/s/p/spacewalk/%{name}-%{version}.tar.gz
@@ -623,6 +623,10 @@ rm -f %{rhnconf}/rhnSecret.py*
# $Id$
%changelog
+* Mon Mar 22 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.9.12-1
+- 571413 - fixed source rpackage push
+- fixing wsgi error handling
+
* Thu Mar 18 2010 Michael Mraka <michael.mraka(a)redhat.com> 0.9.11-1
- 561553 - fixed missing commit
- 564278 - fixed satellite-sync call from rhn-satellite-activate
diff --git a/rel-eng/packages/spacewalk-backend b/rel-eng/packages/spacewalk-backend
index 48cce6b..aa4e063 100644
--- a/rel-eng/packages/spacewalk-backend
+++ b/rel-eng/packages/spacewalk-backend
@@ -1 +1 @@
-0.9.11-1 backend/
+0.9.12-1 backend/
commit 167bc9463c3643a617432cdf891b62e38c28c38b
Author: Michael Mraka <michael.mraka(a)redhat.com>
Date: Mon Mar 22 10:27:31 2010 +0100
571413 - added missing sha256 src rpms code
diff --git a/backend/server/importlib/headerSource.py b/backend/server/importlib/headerSource.py
index d88a182..edce53a 100644
--- a/backend/server/importlib/headerSource.py
+++ b/backend/server/importlib/headerSource.py
@@ -76,10 +76,11 @@ class rpmPackage(IncompletePackage):
self['header_start'] = header_start
self['header_end'] = header_end
self['last_modified'] = localtime(time.time())
- if self['sigmd5']:
- self['sigchecksum_type'] = 'md5'
- self['sigchecksum'] = self['sigmd5']
- del(self['sigmd5'])
+ if 'sigmd5' in self:
+ if self['sigmd5']:
+ self['sigchecksum_type'] = 'md5'
+ self['sigchecksum'] = self['sigmd5']
+ del(self['sigmd5'])
# Fix some of the information up
vendor = self['vendor']
diff --git a/backend/server/importlib/importLib.py b/backend/server/importlib/importLib.py
index b0a6e4a..982010d 100644
--- a/backend/server/importlib/importLib.py
+++ b/backend/server/importlib/importLib.py
@@ -374,8 +374,6 @@ class SourcePackage(IncompletePackage):
'payload_format' : StringType,
'build_host' : StringType,
'build_time' : DateType,
- 'sigchecksum_type' : StringType,
- 'sigchecksum' : StringType,
'vendor' : StringType,
'cookie' : StringType,
'package_size' : IntType,
@@ -385,6 +383,9 @@ class SourcePackage(IncompletePackage):
'md5sum' : StringType, # xml dumps < 3.5
'checksum' : StringType, # xml dumps >= 3.5
'checksum_type' : StringType, # xml dumps >= 3.5
+ 'sigmd5' : StringType, # xml dumps < 3.5 and rpms
+ 'sigchecksum_type' : StringType, # xml dumps >= 3.5
+ 'sigchecksum' : StringType, # xml dumps >= 3.5
}
def __init__(self):
# Inherit from IncompletePackage
diff --git a/backend/server/importlib/packageImport.py b/backend/server/importlib/packageImport.py
index 393a899..38e1a17 100644
--- a/backend/server/importlib/packageImport.py
+++ b/backend/server/importlib/packageImport.py
@@ -498,6 +498,7 @@ class SourcePackageImport(Import):
self._update_last_modified = update_last_modified
self.sourceRPMs = {}
self.groups = {}
+ self.checksums = {}
def preprocess(self):
for package in self.batch:
@@ -506,6 +507,7 @@ class SourcePackageImport(Import):
def fix(self):
self.backend.lookupSourceRPMs(self.sourceRPMs)
self.backend.lookupPackageGroups(self.groups)
+ self.backend.lookupChecksums(self.checksums)
self.__postprocess()
# Uniquify the packages
uniqdict = {}
@@ -566,6 +568,14 @@ class SourcePackageImport(Import):
self.sourceRPMs[sourceRPM] = None
self.groups[package['package_group']] = None
+ checksumTuple = (package['checksum_type'], package['checksum'])
+ if checksumTuple not in self.checksums:
+ self.checksums[checksumTuple] = None
+
+ sigchecksumTuple = (package['sigchecksum_type'], package['sigchecksum'])
+ if sigchecksumTuple not in self.checksums:
+ self.checksums[sigchecksumTuple] = None
+
def __postprocess(self):
# Gather the IDs we've found
@@ -580,6 +590,10 @@ class SourcePackageImport(Import):
# Set the ids
package['package_group'] = self.groups[package['package_group']]
package['source_rpm_id'] = self.sourceRPMs[package['source_rpm']]
+ package['checksum_id'] = self.checksums[(package['checksum_type'],
+ package['checksum'])]
+ package['sigchecksum_id'] = self.checksums[(package['sigchecksum_type'],
+ package['sigchecksum'])]
def _cleanup_object(self, object):
Import._cleanup_object(self, object)
14 years, 3 months
java/code
by Partha Aji
java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ScheduleRemoteCommand.java | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
New commits:
commit 904141a6ad735ff03cd95598f44014574887e747
Author: Partha Aji <paji(a)redhat.com>
Date: Fri Mar 19 17:29:23 2010 -0400
Fixed an annoying checkstyle error
diff --git a/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ScheduleRemoteCommand.java b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ScheduleRemoteCommand.java
index 3a29a35..d9ac4cb 100644
--- a/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ScheduleRemoteCommand.java
+++ b/java/code/src/com/redhat/rhn/frontend/action/rhnpackage/ScheduleRemoteCommand.java
@@ -256,7 +256,7 @@ public class ScheduleRemoteCommand extends RhnAction {
form.set("mode", request.getParameter("mode"));
getStrutsDelegate().prepopulateDatePicker(request,
form, "date", DatePicker.YEAR_RANGE_POSITIVE);
- Date date = getStrutsDelegate().readDatePicker(
+ Date date = getStrutsDelegate().readDatePicker(
form, "date", DatePicker.YEAR_RANGE_POSITIVE);
request.setAttribute("scheduledDate",
14 years, 3 months