From 1851b6b44b8c102fed086c3236a11d925e676a7e Mon Sep 17 00:00:00 2001 From: Narayan Desai Date: Tue, 20 Mar 2007 19:20:54 +0000 Subject: pylint fixes git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@2968 ce84e21b-d406-0410-9b95-82705330c041 --- src/sbin/bcfg2-admin | 37 +++++++++++++++---------------------- 1 file changed, 15 insertions(+), 22 deletions(-) (limited to 'src/sbin/bcfg2-admin') diff --git a/src/sbin/bcfg2-admin b/src/sbin/bcfg2-admin index b8db90640..2a570df56 100755 --- a/src/sbin/bcfg2-admin +++ b/src/sbin/bcfg2-admin @@ -70,8 +70,8 @@ f. Solaris g. Gentoo ''' -def err_exit(msg): - print msg +def err_exit(emsg): + print emsg raise SystemExit, 1 #build bcfg2.conf file @@ -213,10 +213,10 @@ def compare(new, old): print " %s only in new configuration (in bundle %s)" % (entry, name) return False -def do_compare(args): +def do_compare(cargs): '''run file comparison''' - if '-r' in args: - args.remove('-r') + if '-r' in cargs: + cargs.remove('-r') (oldd, newd) = args (old, new) = [os.listdir(spot) for spot in args] for item in old: @@ -231,7 +231,7 @@ def do_compare(args): print "new has extra entries", new return try: - (old, new) = args + (old, new) = cargs except IndexError: print "Usage: bcfg2-admin compare " raise SystemExit @@ -536,9 +536,12 @@ if __name__ == '__main__': if opt in ("-C", "--configfile"): configfile = arg if opt in ("-R", "--repopath"): - repopath = arg + Repopath = arg # ...then do something with the other arguments + if Repopath == '': + Repopath = get_repo_path(configfile) + if len(args) < 1: print usage @@ -549,24 +552,16 @@ if __name__ == '__main__': if len(args) != 4: print usage raise SystemExit, 1 - if repopath == "": - repopath = get_repo_path(configfile) - do_pull(configfile, repopath, args[1], args[2], args[3]) + do_pull(configfile, Repopath, args[1], args[2], args[3]) elif args[0] == 'minestruct': - if repopath == "": - repopath = get_repo_path(configfile) - do_minestruct(repopath, args[1:]) + do_minestruct(Repopath, args[1:]) elif args[0] == 'tidy': - if repopath == "": - repopath = get_repo_path(configfile) - do_tidy(repopath, args[1:]) + do_tidy(Repopath, args[1:]) elif args[0] == 'viz': - if repopath == "": - repopath = get_repo_path(configfile) - do_viz(repopath, args[1:]) + do_viz(Repopath, args[1:]) elif args[0] == 'compare': do_compare(args[1:]) @@ -578,8 +573,6 @@ if __name__ == '__main__': if len(args) < 4: print usage raise SystemExit, 1 - if repopath == "": - repopath = get_repo_path(configfile) - do_client(repopath, args[1:]) + do_client(Repopath, args[1:]) else: print usage -- cgit v1.2.3-1-g7c22