[Spacewalk-list] [patch] spacecmd fails on Base64 encoded data and UTF-8

David Juran djuran at redhat.com
Mon Sep 23 09:35:21 UTC 2013


Hello!

Attached is a small patch which fixes spacecmd handling when Red Hat
Satellite (5.5) occasionally chooses to return Base64 encoded data.
There probably are more places where the Satellite can opt to return
Base64 encoded data, it would be good to grep through the API docs and
add the necessary support to spacecmd. 

I also got an error output
ERROR: 'ascii' codec can't encode character u'\xe5' in position 392: ordinal not in range(128)
and then the list of results (from schedule_getoutput) got truncated.
The problem got solved by encoding the output as UTF-8 (inspiration
gathered from do_kickstart_getcontent in kickstart.py) though I'm not
quite quite sure why this encoding is necessary since the xmlrpclib
manual states that the encoding by default is UTF-8 already. 
And on the other hand, if this statement really is necessary, it would
be good if it was possible to somewhere set the "default" encoding to
UTF-8 so that each and every print statement doesn't have to be
modified. But that is where my feeble python-skills end, so maybe
someone else have any ideas (-: 

-- 
David Juran
Sr. Consultant
Red Hat
+46-725-345801
-------------- next part --------------
A non-text attachment was scrubbed...
Name: spacecmd-output.patch
Type: text/x-patch
Size: 866 bytes
Desc: not available
URL: <http://listman.redhat.com/archives/spacewalk-list/attachments/20130923/97adffef/attachment.bin>


More information about the Spacewalk-list mailing list