Re: rhn_register questions

Patrick Devine <[email protected]> Wed, 23 Oct 2002 15:41:06 -0700 (PDT)
Newsgroups gmane.network.up2date.current.devel
Message-ID <[email protected]>
On 23 Oct 2002, Hunter Matthews wrote:

> On Wed, 2002-10-23 at 17:20, Patrick Devine wrote:
> > On Wed, 23 Oct 2002, John Berninger wrote:
> > 
> > > We're using the server because it generates the systemid based on the
> > > secret string in the server's configuration file.  Each time the client
> > > connects, the sysid is checked against the secret string and other
> > > information to make sure that it's authorized to be an anonymous client
> > > - much as that seems like it shouldn't make sense.
> > 
> > Right .. I'm just thinking that it would be really easy to make a python 
> > script which just called registerSystem() in rhnreg.py without the hassle 
> > of having to run rhn_register.  I'll see if I can cook something up.
> 
> It would (it is - I've modified the rhnreg_ks script here to have an
> --anon option) I'm just trying to keep the client side as "pristine" as
> possible.
> 
> rhnreg_ks --username=x --password=x --email=x --nohardware --nopackages
> 
> is a simple, fast way to do it.

Cool.. I just did this which seems to work:

...


#!/usr/bin/python
#
#

import sys
sys.path.append("/usr/share/rhn/register")

import rhnreg

userName = 'anonymous'
userPassword = 'empty'
userProfile = 'profile'

id = rhnreg.registerSystem(userName, userPassword, userProfile)

--Patrick.