[rancid] Re: Why doesn't rancid use perl modules?
eravin at panix.com
Tue Sep 26 00:45:36 UTC 2006
On Mon, Sep 25, 2006 at 04:41:00PM -0700, Lance Vermilion wrote:
> Hey All,
> I was just looking at some things and doing some changes. I
> noticed there are no perl modules used for things that are used in
> all the perl scripts. Is there a reason for this? If there is no
> reason for this I would like to propose moving to perl modules so
> that the code used in each perl script is less and changes can be
> made to one module and it would apply to all scripts that reference
> that module.
Do you have the time to help do the work? I think the biggest problem
with RANCID development at the moment is not the lack of ideas, but the
lack of developers.
I'd also like to work on modularizing clogin - ideally, we would end
up with one rancid script, one clogin script, and a bunch of configuration
files that defined the differences for 90% of the devices and a few
extra code modules for the other 10%. The new clogin and rancid would
be totally driven by a config file - a few parameters like prompts,
timeouts, autoenable, etc., and pointers to code modules for weird
devices that need custom hacking.
Then we'd have to test it all and make sure it still works :-).
I think the hardest part is coming up with a good "skeleton" that
would become the new framework for all the scripts. Ideally, the
framework would be optimized for easy customization, and it would
be straightforward to convert existing perl and expect scripts
into the new framework.
Currently, the only part of RANCID that is "easy" to customize is
cloginrc. I'm not fond of the format, but it works. I've already
written a Perl module that parses cloginrc (by calling expect on it),
so a cloginrc-formatted could be used to customize both Perl and
Expect scripts. My first instinct is to reach for something broader
and start from scratch, but that risks hitting the second-system
effect - it's much more important to modularize RANCID, the config
file can always be improved later.
More information about the Rancid-discuss