<div dir="ltr">I switched from perl to python for all my api scripts about 3 months ago, and am working through my existing perl scripts to convert them to python.  <div>python's much easier for working w/ the API as far as I've found...</div>
<div><br></div><div>You probably already know this, but if you are manually inputting the key, don't forget to include the prefix (1- in my case) to the key..  If you are using listActivationKeys you should get it anyway with the 'key'.</div>
<div><br></div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Oct 30, 2013 at 11:33 AM, Maria Iano <span dir="ltr"><<a href="mailto:maria@purplecoffee.com" target="_blank">maria@purplecoffee.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On Wed, Oct 30, 2013 at 09:40:12AM -0400, wm-lists wrote:<br>
> Can you provide the request you are using? I just tested on Satellite 5.5<br>
> using the following and it seems to work ok for me<br>
><br>
>     EKEYS = client.activationkey.listActivationKeys(seskey)<br>
>                 for EKEY in EKEYS:<br>
>                         if  EKEY.get('description') == KEY_NAME:<br>
>                                 print "Getting Key Details" + KEY_NAME<br>
>                                 DETAILS =<br>
> client.activationkey.getDetails(seskey,EKEY.get('key'))<br>
>                                 print DETAILS.get('description') + " " +<br>
> DETAILS.get('key') + " " + str(DETAILS.get('usage_limit'))<br>
><br>
><br>
> Getting Key Detailsact-pci-vdc-unit-rhel6-x86_64<br>
> act-pci-vdc-unit-rhel6-x86_64 1-act-pci-vdc-unit-rhel6-x86_64 0<br>
> complete<br>
><br>
<br>
</div>Thanks, it's useful to hear it does work in python. Here is how I call the api in my script for a single key.<br>
<br>
my $key = $opt_a;<br>
# my $key = $client->string($opt_a); # this didn't work either<br>
my $details = $client->call('activationkey.getDetails', $session, $key);<br>
<br>
At least I now have a workaround of doing it in python with a chunk of working code to start from.<br>
<br>
Thanks,<br>
Maria<br>
<div class="HOEnZb"><div class="h5"><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>
</div></div></blockquote></div><br></div>