client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py | 12 +++++++-
client/rhel/rhn-client-tools/src/up2date_client/hardware.py | 10 ++++++
client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py | 6 +++-
client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py | 13 ++++++++
client/rhel/rhn-client-tools/src/up2date_client/tui.py | 16 ++++++++++-
5 files changed, 53 insertions(+), 4 deletions(-)
New commits:
commit 7c5ffe3f424e16a2b42ec7ea6c3f2409c9b72dee
Author: Pradeep Kilambi <pkilambi(a)redhat.com>
Date: Wed Apr 29 17:22:56 2009 -0400
Adding support to send smbios information to the servers if implemented.
add_smbios_info needs to be implemented on the server to fully take advantage of this
call. Xen host/guests + para/fully virt types should work as usual for now.
diff --git a/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
b/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
index a0694d4..234412a 100755
--- a/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
+++ b/client/rhel/rhn-client-tools/src/bin/rhnreg_ks.py
@@ -151,7 +151,17 @@ class RegisterKsCli(rhncli.RhnCli):
up2dateErrors.CommunicationError), e:
print "%s" % e.errmsg
sys.exit(1)
-
+
+ # send smbios info to the server
+ smbiosData = hardware.get_hal_smbios()
+ try:
+ rhnreg.sendSmbiosInfo(systemId, smbiosData)
+ except AttributeError:
+ # Method Not Implemented, continue
+ pass
+ except:
+ print _("Problem sending smbios information.")
+
# collect hardware info, inluding hostname
if not self.options.nohardware:
rhnreg.sendHardware(systemId, hardwareList)
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
b/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
index 7204644..95cb706 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/hardware.py
@@ -870,6 +870,16 @@ def get_hal_system_and_smbios():
return system_and_smbios
+def get_hal_smbios():
+ computer = get_hal_computer()
+
+ props = computer.GetAllProperties()
+ smbios = {}
+ for key in props:
+ if key.startswith('smbios'):
+ smbios[str(key)] = props[str(key)]
+ return smbios
+
# this one reads it all
def Hardware():
allhw = []
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
index 8494619..e15bbb2 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py
@@ -623,7 +623,11 @@ def sendHardware(systemId, hardwareList):
def sendPackages(systemId, packageList):
s = rhnserver.RhnServer()
s.registration.add_packages(systemId, packageList)
-
+
+def sendSmbiosInfo(systemId, smbiosData):
+ s = rhnserver.RhnServer()
+ s.registration.add_smbios_info(systemId, smbiosData)
+
def sendVirtInfo(systemId):
if support is not None:
support.refresh()
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
index 28da943..8d63302 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnregGui.py
@@ -1072,7 +1072,18 @@ class CreateProfilePage:
if ret:
return ret
pwin.setProgress(3, 6)
-
+
+ # send smbios info to the server
+ pwin.setStatusLabel(_("Sending smbios information"))
+ smbiosData = hardware.get_hal_smbios()
+ try:
+ rhnreg.sendSmbiosInfo(self.systemId, smbiosData)
+ except AttributeError:
+ # Method Not Implemented on server, continue
+ pass
+ except:
+ pwin.setStatusLabel(_("Problem sending smbios information."))
+
# maybe upload hardware profile
if self.sendHardware:
pwin.setStatusLabel(_("Sending hardware information"))
diff --git a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
index 8dd40b9..90e9d64 100644
--- a/client/rhel/rhn-client-tools/src/up2date_client/tui.py
+++ b/client/rhel/rhn-client-tools/src/up2date_client/tui.py
@@ -357,6 +357,7 @@ class InfoWindow:
[(NEXT, "next"),
(BACK, "back"),
(CANCEL, "cancel")])
+
# Hosted
else:
label = snack.TextboxReflowed(size[0]-10,HOSTED_LOGIN_PROMPT)
@@ -802,7 +803,7 @@ class OSReleaseWindow:
if self.all_updates_button.selected() or later_release:
CONFIRM_OS_ALL = _("Your system will be subscribed to the base"
- " software channel to receives all available"
+ " software channel to receive all available"
" updates.")
msgbox = snack.ButtonChoiceWindow(self.screen, title,
CONFIRM_OS_ALL, buttons =[OK, CANCEL])
@@ -1119,6 +1120,7 @@ class FinishWindow:
# reg_info dict contains: 'system_id', 'channels',
# 'failed_channels', 'slots', 'failed_slots'
log.log_debug('other is %s' % str(self.tui.other))
+
reg_info = rhnreg.registerSystem2(tui.userName, tui.password,
tui.profileName,
other = self.tui.other)
@@ -1184,6 +1186,18 @@ class FinishWindow:
self.setScale(3, 5)
+ # send smbios info to the server
+ smbiosData = hardware.get_hal_smbios()
+ try:
+ rhnreg.sendSmbiosInfo(self.systemId, smbiosData)
+ except AttributeError:
+ # Method Not Implemented, continue
+ pass
+ except:
+ log.log_exception(*sys.exc_info())
+ FatalErrorWindow(self.screen,
+ _("Problem sending smbios info:\n"))
+
# maybe upload hardware profile
if tui.includeHardware:
try: