diff options
author | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-01-26 13:19:58 -0500 |
---|---|---|
committer | Chris St. Pierre <chris.a.st.pierre@gmail.com> | 2012-01-26 13:19:58 -0500 |
commit | 75c6e2ac28a6f406d679a44dc399c5eb6d6d25e1 (patch) | |
tree | 28a76153bba1848017aaf750d5c9b14a0c6e122e /src/lib/Server/Admin/Tidy.py | |
parent | 1ef9f2ce0af301cda6f21653def563450eaaf327 (diff) | |
download | bcfg2-75c6e2ac28a6f406d679a44dc399c5eb6d6d25e1.tar.gz bcfg2-75c6e2ac28a6f406d679a44dc399c5eb6d6d25e1.tar.bz2 bcfg2-75c6e2ac28a6f406d679a44dc399c5eb6d6d25e1.zip |
made bcfg2-admin accept -Q flag and a few others; general code cleanup
Diffstat (limited to 'src/lib/Server/Admin/Tidy.py')
-rw-r--r-- | src/lib/Server/Admin/Tidy.py | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/lib/Server/Admin/Tidy.py b/src/lib/Server/Admin/Tidy.py index f79991fd9..82319b93e 100644 --- a/src/lib/Server/Admin/Tidy.py +++ b/src/lib/Server/Admin/Tidy.py @@ -16,9 +16,6 @@ class Tidy(Bcfg2.Server.Admin.Mode): "-I", "interactive")) - def __init__(self, cfile): - Bcfg2.Server.Admin.Mode.__init__(self, cfile) - def __call__(self, args): Bcfg2.Server.Admin.Mode.__call__(self, args) badfiles = self.buildTidyList() @@ -49,7 +46,7 @@ class Tidy(Bcfg2.Server.Admin.Mode): bad = [] # clean up unresolvable hosts in SSHbase - for name in os.listdir("%s/SSHbase" % (self.get_repo_path())): + for name in os.listdir("%s/SSHbase" % self.setup['repo']): if hostmatcher.match(name): hostname = hostmatcher.match(name).group(1) if hostname in good + bad: @@ -59,14 +56,14 @@ class Tidy(Bcfg2.Server.Admin.Mode): good.append(hostname) except: bad.append(hostname) - for name in os.listdir("%s/SSHbase" % (self.get_repo_path())): + for name in os.listdir("%s/SSHbase" % self.setup['repo']): if not hostmatcher.match(name): - to_remove.append("%s/SSHbase/%s" % (self.get_repo_path(), + to_remove.append("%s/SSHbase/%s" % (self.setup['repo'], name)) else: if hostmatcher.match(name).group(1) in bad: to_remove.append("%s/SSHbase/%s" % - (self.get_repo_path(), name)) + (self.setup['repo'], name)) # clean up file~ # clean up files without parsable names in Cfg return to_remove |