summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSol Jerome <solj@ices.utexas.edu>2008-07-28 23:47:09 +0000
committerSol Jerome <solj@ices.utexas.edu>2008-07-28 23:47:09 +0000
commit3d29375196c124405db4d256dc8368f39e9160d1 (patch)
tree5705bdb21f02c534e2b5765f96f24cb75d9451c1 /src
parentcc7c9309271eeee32e294a6fb1111f76988cf95e (diff)
downloadbcfg2-3d29375196c124405db4d256dc8368f39e9160d1.tar.gz
bcfg2-3d29375196c124405db4d256dc8368f39e9160d1.tar.bz2
bcfg2-3d29375196c124405db4d256dc8368f39e9160d1.zip
Fix for Directory prune attribute.
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@4833 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r--src/lib/Client/Tools/POSIX.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/src/lib/Client/Tools/POSIX.py b/src/lib/Client/Tools/POSIX.py
index df8558e1d..48531e4c2 100644
--- a/src/lib/Client/Tools/POSIX.py
+++ b/src/lib/Client/Tools/POSIX.py
@@ -150,23 +150,23 @@ class POSIX(Bcfg2.Client.Tools.Tool):
(mtime == entry.get('mtime', '-1')))
pruneTrue = True
- self.ex_ents = []
+ ex_ents = []
if entry.get('prune', 'false') == 'true' \
and entry.tag == 'Directory':
try:
entries = ['/'.join([entry.get('name'), ent]) \
for ent in os.listdir(entry.get('name'))]
- self.ex_ents = [e for e in entries if e not in modlist]
- if self.ex_ents:
+ ex_ents = [e for e in entries if e not in modlist]
+ if ex_ents:
pruneTrue = False
self.logger.debug("Directory %s contains extra entries:" % entry.get('name'))
- self.logger.debug(self.ex_ents)
+ self.logger.debug(ex_ents)
nqtext = entry.get('qtext', '') + '\n'
nqtext += "Directory %s contains extra entries:" % entry.get('name')
- nqtext += ":".join(self.ex_ents)
+ nqtext += ":".join(ex_ents)
entry.set('qtest', nqtext)
except OSError:
- self.ex_ents = []
+ ex_ents = []
pruneTrue = True
if not pTrue:
@@ -257,8 +257,8 @@ class POSIX(Bcfg2.Client.Tools.Tool):
except OSError:
self.logger.error('Failed to create directory %s' % (entry.get('name')))
return False
- if entry.get('prune', 'false') == 'true' and self.ex_ents:
- for pname in self.ex_ents:
+ if entry.get('prune', 'false') == 'true' and entry.get("qtest"):
+ for pname in entry.get("qtest").split(":"):
ulfailed = False
try:
self.logger.debug("Unlinking file %s" % pname)