<div dir="ltr"><div>Thanks David, committed as 1f0896775c6e9651a99e91b062c0629e84e84f48.  If possible, please use a git-formatted patch in the future so it has the author and message already in the patch.</div><div><br></div>
<div>Not sure on the UTF-8 issue as I haven't seen that pop up.  I'll run through my script output history on a busier Spacewalk instance and see if I can recreate tomorrow.</div><br><div class="gmail_extra"><div>
/aron</div>
<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><br>
________________________________________<br>
Date: Mon, 23 Sep 2013 11:35:21 +0200<br>
From: David Juran <<a href="mailto:djuran@redhat.com">djuran@redhat.com</a>><br>
To: <a href="mailto:spacewalk-list@redhat.com">spacewalk-list@redhat.com</a><br>
Subject: [Spacewalk-list] [patch] spacecmd fails on Base64 encoded<br>
        data and        UTF-8<br>
Message-ID: <1379928921.5526.13.camel@localhost.localdomain><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello!<br>
<br>
Attached is a small patch which fixes spacecmd handling when Red Hat<br>
Satellite (5.5) occasionally chooses to return Base64 encoded data.<br>
There probably are more places where the Satellite can opt to return<br>
Base64 encoded data, it would be good to grep through the API docs and<br>
add the necessary support to spacecmd.<br>
<br>
I also got an error output<br>
ERROR: 'ascii' codec can't encode character u'\xe5' in position 392: ordinal not in range(128)<br>
and then the list of results (from schedule_getoutput) got truncated.<br>
The problem got solved by encoding the output as UTF-8 (inspiration<br>
gathered from do_kickstart_getcontent in kickstart.py) though I'm not<br>
quite quite sure why this encoding is necessary since the xmlrpclib<br>
manual states that the encoding by default is UTF-8 already.<br>
And on the other hand, if this statement really is necessary, it would<br>
be good if it was possible to somewhere set the "default" encoding to<br>
UTF-8 so that each and every print statement doesn't have to be<br>
modified. But that is where my feeble python-skills end, so maybe<br>
someone else have any ideas (-:<br>
<br>
--<br>
David Juran<br>
Sr. Consultant<br>
Red Hat<br>
+46-725-345801<br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: spacecmd-output.patch<br>
Type: text/x-patch<br>
Size: 866 bytes<br>
Desc: not available<br>
URL: <<a href="https://www.redhat.com/archives/spacewalk-list/attachments/20130923/97adffef/attachment.bin" target="_blank">https://www.redhat.com/archives/spacewalk-list/attachments/20130923/97adffef/attachment.bin</a>><br>

<br>
------------------------------<br>
<br>
Message: 4<br>
Date: Mon, 23 Sep 2013 17:07:46 +0200<br>
From: David Juran <<a href="mailto:djuran@redhat.com">djuran@redhat.com</a>><br>
To: <a href="mailto:spacewalk-list@redhat.com">spacewalk-list@redhat.com</a><br>
Subject: [Spacewalk-list] [patch] spacecmd credentials cache doesn't<br>
        work    for normal user<br>
Message-ID: <1379948866.11335.24.camel@localhost.localdomain><br>
Content-Type: text/plain; charset="utf-8"<br>
<br>
Hello!<br>
<br>
Spacecmd uses the user.listUsers API call to validate the credentials<br>
cache. This is suboptimal since a normal user isn't allowed to run this<br>
call, forcing him to always enter his password.<br>
The attached one-liner instead changes the test to api.getApiNamespaces<br>
to test the cache, but I guess any unprivileged operation would do.<br>
<br>
--<br>
David Juran<br>
Sr. Consultant<br>
Red Hat<br>
<a href="tel:%2B46-725-345801" value="+46725345801">+46-725-345801</a><br>
-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: spacecmd-validate-credentials-cache.patch<br>
Type: text/x-patch<br>
Size: 527 bytes<br>
Desc: not available<br>
URL: <<a href="https://www.redhat.com/archives/spacewalk-list/attachments/20130923/309e4b21/attachment.bin" target="_blank">https://www.redhat.com/archives/spacewalk-list/attachments/20130923/309e4b21/attachment.bin</a>><br>

<br>
------------------------------<br>
<br>
_______________________________________________<br>
Spacewalk-list mailing list<br>
<a href="mailto:Spacewalk-list@redhat.com">Spacewalk-list@redhat.com</a><br>
<a href="https://www.redhat.com/mailman/listinfo/spacewalk-list" target="_blank">https://www.redhat.com/mailman/listinfo/spacewalk-list</a><br>
<br>
End of Spacewalk-list Digest, Vol 64, Issue 26<br>
**********************************************<br>
</blockquote></div><br></div></div>