client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
New commits: commit f54af17a889ab9e5a56e34cc81787aede9f87ce6 Author: Milan Zazrivec mzazrivec@redhat.com Date: Wed Aug 3 11:50:39 2011 +0200
702107 - cogent error message for exception when listing child channels
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 22a120a..bacb619 100644 --- a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py +++ b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py @@ -97,7 +97,12 @@ 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)): + try: + channels = client.system.listChildChannels(key, int(system_id)) + except xmlrpclib.Fault, exc: + systemExit(1, "Error when listing child channels: %s" % exc.faultString) + + for channel in channels: if 'LABEL' in channel: result.extend([channel['LABEL']]) else: