client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
New commits:
commit ca87a0cf8dbaa751dabc6166a69becd33618afdb
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Mon Jul 25 18:37:13 2011 +0200
713548 - enable running rhn-channel on RHEL5
RHEL5 contains: Python 2.4.3
and urlparse.SplitResult is avauilable since Python 2.5
diff --git a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
index 9f90da2..68c1095 100644
--- a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
+++ b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
@@ -86,10 +86,8 @@ def get_available_channels(user, password):
""" return list of available child channels """
cfg = config.initUp2dateConfig()
satellite_url = config.getServerlURL()[0]
- parts = urlparse.urlsplit(satellite_url)
- satellite_url = urlparse.SplitResult(parts.scheme, parts.netloc, '/rpc/api',
- parts.query, parts.fragment).geturl()
-
+ scheme, netloc, path, query, fragment = urlparse.urlsplit(satellite_url)
+ satellite_url = urlparse.urlunsplit((scheme, netloc, '/rpc/api', query,
fragment))
client = xmlrpclib.Server(satellite_url, verbose=0)
key = client.auth.login(user, password)
system_id = re.sub('^ID-', '',
rpclib.xmlrpclib.loads(up2dateAuth.getSystemId())[0][0]['system_id'])
commit 68d8541e8dfebc49d510d1b6103376926115780f
Author: Tomas Lestach <tlestach(a)redhat.com>
Date: Mon Jul 25 18:35:28 2011 +0200
713548 - enable running rhn-channel against both RHN and RHN Satellite
diff --git a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
index f1b1cde..9f90da2 100644
--- a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
+++ b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py
@@ -95,7 +95,10 @@ def get_available_channels(user, password):
system_id = re.sub('^ID-', '',
rpclib.xmlrpclib.loads(up2dateAuth.getSystemId())[0][0]['system_id'])
result = []
for channel in client.system.listChildChannels(key, int(system_id)):
- result.extend([channel['LABEL']])
+ if 'LABEL' in channel:
+ result.extend([channel['LABEL']])
+ else:
+ result.extend([channel['label']])
return result
def need_channel(channel):
Show replies by date