[Spacewalk-list] Python API examples

Colin Coe colin.coe at gmail.com
Thu Nov 19 03:31:09 UTC 2009


Thanks Andy

I've sorted my initial problem

sys['id'] did the trick

Thanks again

CC

On 11/19/09, Speagle, Andy <andy.speagle at wichita.edu> wrote:
> Hey,
>
> If you scan the list, I've posted some code for cloning errata.  Those should be somewhat helpful, though my skill with python is laughable.
>
> Andy
> Sent via BlackBerry from T-Mobile
>
> -----Original Message-----
> From: Colin Coe <colin.coe at gmail.com>
> Date: Wed, 18 Nov 2009 20:25:11
> To: spacewalk-list at redhat.com<spacewalk-list at redhat.com>
> Subject: [Spacewalk-list] Python API examples
>
> Hi all
>
> I'm just starting re-writing my Satellite/Spacewalk API scripts to use
> Python not Perl.  I'm using this as an exercise to learn Python.  I'm
> having difficulty finding decent Python API script examples.  Could
> someone point me at some?
>
> Specifically, I can't work out how to reference the system ID I get from:
> ---
> systems = client.system.listUserSystems(session)
> for sys in systems:
>   print sys
>
> {'last_checkin': <DateTime u'20091119T10:06:53' at 2ba5b4c775f0>,
> 'id': 1000010011, 'name': 'test.sys'}
> ---
>
> (No, https://my.sat/rhn/apidoc/scripts.jsp isn't very helpful)
>
> I need to do this conversion as NetAddr::IP and Frontier::RPC are not
> provided with RHEL (at least not yet).
>
> TIA
>
> CC
>
> --
> RHCE#805007969328369
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>
> _______________________________________________
> Spacewalk-list mailing list
> Spacewalk-list at redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-list
>


-- 
RHCE#805007969328369




More information about the Spacewalk-list mailing list