Bug 790748
Summary: | error message appears mentioning SubscriptionManager when registering to Spacewalk | |||
---|---|---|---|---|
Product: | [Community] Spacewalk | Reporter: | Jan Hutař <jhutar> | |
Component: | Clients | Assignee: | Jan Pazdziora (Red Hat) <jpazdziora> | |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Red Hat Satellite QA List <satqe-list> | |
Severity: | low | Docs Contact: | ||
Priority: | unspecified | |||
Version: | 1.6 | CC: | jpazdziora, xdmoon | |
Target Milestone: | --- | |||
Target Release: | --- | |||
Hardware: | Unspecified | |||
OS: | Unspecified | |||
Whiteboard: | ||||
Fixed In Version: | rhn-client-tools-1.7.11-1 | Doc Type: | Bug Fix | |
Doc Text: | Story Points: | --- | ||
Clone Of: | ||||
: | 798181 (view as bug list) | Environment: | ||
Last Closed: | 2012-03-07 09:53:56 UTC | Type: | --- | |
Regression: | --- | Mount Type: | --- | |
Documentation: | --- | CRM: | ||
Verified Versions: | Category: | --- | ||
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | ||
Cloudforms Team: | --- | Target Upstream Version: | ||
Embargoed: | ||||
Bug Depends On: | ||||
Bug Blocks: | 765736, 798181 |
Description
Jan Hutař
2012-02-15 10:34:45 UTC
The problem is caused by code def _introspect_error_handler(self, error): self._introspect_state = self.INTROSPECT_STATE_DONT_INTROSPECT self._introspect_execute_queue() sys.stderr.write("Introspect error: " + str(error) + "\n") in /usr/lib/python2.4/site-packages/dbus/proxies.py. Modules should just raise exception, sadly here they insist on also writing to stderr. Possible patch #1: 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 8d2b640..5eb39b0 100644 --- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py +++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py @@ -351,6 +351,12 @@ def registerSystem(username = None, password = None, return ret +class EatSTDERR: + def __init__(self): + pass + def write(self, data): + pass + def updateRhsmStatus(): try: bus = dbus.SystemBus() @@ -363,13 +369,20 @@ def updateRhsmStatus(): # install. we can't do anything here, so just ignore it. return + orig_sys_stderr = sys.stderr try: + sys.stderr = EatSTDERR() validity_iface.check_status() + sys.stderr = orig_sys_stderr except dbus.DBusException: + sys.stderr = orig_sys_stderr # the call timed out, or something similar. we don't really care # about a timely reply or what the result might be, we just want # the method to run. So we can safely ignore this. pass + except Exception: + sys.stderr = orig_sys_stderr + raise def getAvailableChannels(username, password): Possible patch #2: 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 8d2b640..9fe2cb1 100644 --- a/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py +++ b/client/rhel/rhn-client-tools/src/up2date_client/rhnreg.py @@ -354,8 +354,8 @@ def registerSystem(username = None, password = None, def updateRhsmStatus(): try: bus = dbus.SystemBus() - validity_obj = bus.get_object('com.redhat.SubscriptionManager', - '/EntitlementStatus') + validity_obj = bus.ProxyObjectClass(bus, 'com.redhat.SubscriptionManager', + '/EntitlementStatus', introspect=False) validity_iface = dbus.Interface(validity_obj, dbus_interface='com.redhat.SubscriptionManager.EntitlementStatus') except dbus.DBusException: Jan, is this also a regression in RHEL 5.8? The minimal reproducer is PYTHONPATH=/usr/share/rhn python -c 'from up2date_client import rhnreg; rhnreg.updateRhsmStatus();' I went with the patch from comment 3, Spacewalk master, 0b0853a6a0f6064e4150e9e6d64c426374775069. Spacewalk 1.7 has been released: https://fedorahosted.org/spacewalk/wiki/ReleaseNotes17 |