[rancid] Renaming devices? (svn backend)
daniel.schmidt at wyo.gov
Wed Apr 17 15:28:15 UTC 2013
An example: I threw something together quick (not well - quick) for the
other network guys so they could copy/paste output. If I weren't so
lazy/busy, I would make it run the commands it's self, set a path at the
top, yada yada. Change paths & it work 4 U.
$ cat stupid_change.py
# Just tell me how to change it!
# not written well, just written in 15 minutes
# could probably be done in bash
def check_yn(message, default):
answer = ''
while not ((answer == 'y') or (answer =='n')):
answer = raw_input(message)
answer = answer.lower()
if answer == '':
if answer == 'y':
def gen_crap(old_name, new_name, type):
print ("sed -i 's/%s/%s/g' /home/rancid/var/%s/router.db"
% (old_name, new_name, type))
print ("cp -p /home/rancid/var/CVS/%s/configs/%s,v \
% (type, old_name, type, new_name))
print "cd /home/rancid/var/%s/configs" % type
print "cvs update"
print "/home/rancid/bin/rancid-run -r %s" % new_name
print "cd ~\n"
if not len(sys.argv) == 3:
if len(sys.argv) == 4:
gen_crap(sys.argv, sys.argv, sys.argv)
print "Usage:\n./stupid_change.py old_name new_name
if check_yn("Is this a switch?(y):", True):
gen_crap(sys.argv, sys.argv, 'Switches')
gen_crap(sys.argv, sys.argv, 'Routers')
if __name__ == "__main__":
From: rancid-discuss-bounces at shrubbery.net
[mailto:rancid-discuss-bounces at shrubbery.net] On Behalf Of Howard Jones
Sent: Wednesday, April 17, 2013 7:42 AM
To: rancid-discuss at shrubbery.net
Subject: [rancid] Renaming devices? (svn backend)
I'm just about to implement a new naming scheme for all our network gear,
and I'd like to rename it in such a way that I don't lose the history in
RANCID. I found a couple of messages in the list archive for the way to do
this with a CVS backend, but I have Subversion. Does anyone know the
svn-fu necessary to do this cleanly?
Rancid-discuss mailing list
Rancid-discuss at shrubbery.net
E-Mail to and from me, in connection with the transaction
of public business, is subject to the Wyoming Public Records
Act and may be disclosed to third parties.
More information about the Rancid-discuss