client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
New commits: commit 6ba24293db19d5675de87c0c6e05f03d22e5afad Author: Milan Zazrivec mzazrivec@redhat.com Date: Mon Aug 1 17:40:39 2011 +0200
702084 - rhn-channel: meaningful message when wrong username / password
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 68c1095..22a120a 100644 --- a/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py +++ b/client/rhel/rhn-client-tools/src/bin/spacewalk-channel.py @@ -89,7 +89,12 @@ def get_available_channels(user, password): 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) + try: + key = client.auth.login(user, password) + except xmlrpclib.Fault, exc: + sys.stderr.write("Error during client authentication: %s" % exc.faultString) + sys.exit(1) + 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)):