Mirek,

I was looking at up2date client libraries, I'm bit confused as to how it 
functions with RHN/Spacewalk. Specifically, I'm at loss how I would make a call 
to get server details to see if it is locked. I dug through the libraries 
(which is not well documented) and could not find anything the clearly 
illustrates the interaction with RHN via RHN APIs. 

If there is a doc you can point me too or an example - I would certainly 
appreciate it. 

Thanks

Regards
ilya

-----Original Message-----
From: spacewalk-devel-boun...@redhat.com 
[mailto:spacewalk-devel-boun...@redhat.com] On Behalf Of Musayev, Ilya
Sent: Friday, June 08, 2012 10:50 AM
To: spacewalk-devel@redhat.com
Cc: spacewalk-devel@redhat.com
Subject: Re: [Spacewalk-devel] YUM RHN Lock Plugin

Thanks Mirek

I will try to polish it, your response is very helpful.

Regards
Ilya

On Jun 8, 2012, at 4:57 AM, "Miroslav Suchý" <msu...@redhat.com> wrote:

> On 06/08/2012 12:32 AM, Musayev, Ilya wrote:
>> The proof of concept code is below - if you could make any suggestions and 
>> improvements - it would be appreciated.
> 
> Instead of getSystemID(xml) you can use:
>  from rhn import rpclib
>  system_id = re.sub('^ID-', '',
> rpclib.xmlrpclib.loads(up2dateAuth.getSystemId())[0][0]['system_id'])
> 
> 
> Instead of:
>  client = xmlrpclib.Server(SATELLITE_URL, verbose=0)  key = 
> client.auth.login(SATELLITE_LOGIN, SATELLITE_PASSWORD) you can do:
>  cfg = config.initUp2dateConfig()
>  satellite_url = config.getServerlURL()[0]  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)
> 
> This seems to be longer and complicated, but you get spacewalk url 
> from config and you will get all url of possible parents. You may have 
> more then once for fail over.
> It would be nice if you do instead of:
>  satellite_url = config.getServerlURL()[0] loop over all items in 
> config.getServerlURL() if some network error happen.
> 
> Additionaly I would change:
>  enabled=1
> to 0. Because it will cause huge problem to people who install it, but 
> did not register to Spacewalk server.
> 
> Anyway - good idea. If you will polish it and test it, I will be happy 
> to merge it to yum-rhn-plugin.
> 
> --
> Miroslav Suchy
> Red Hat Satellite Engineering
> 
> _______________________________________________
> Spacewalk-devel mailing list
> Spacewalk-devel@redhat.com
> https://www.redhat.com/mailman/listinfo/spacewalk-devel
> 

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

_______________________________________________
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel

Reply via email to