summaryrefslogtreecommitdiffstats
path: root/src/lib/Client/Tools/POSIX.py
diff options
context:
space:
mode:
authorTim Laszlo <tim.laszlo@gmail.com>2010-09-24 03:44:25 +0000
committerSol Jerome <sol.jerome@gmail.com>2010-09-26 15:27:08 -0500
commit65e9f126aa56226466d918b2c66d85290d183273 (patch)
tree87297daa925589d2e96c109d0f7b1613fda96711 /src/lib/Client/Tools/POSIX.py
parent202a61db37490b84a256674a6fb95b88edbeafbd (diff)
downloadbcfg2-65e9f126aa56226466d918b2c66d85290d183273.tar.gz
bcfg2-65e9f126aa56226466d918b2c66d85290d183273.tar.bz2
bcfg2-65e9f126aa56226466d918b2c66d85290d183273.zip
Group paths to prune as an element
Avoids a potential problem where paths with a : in the name are not removed. git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@6071 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src/lib/Client/Tools/POSIX.py')
-rw-r--r--src/lib/Client/Tools/POSIX.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/Client/Tools/POSIX.py b/src/lib/Client/Tools/POSIX.py
index 8fc07dd60..9d37b77d3 100644
--- a/src/lib/Client/Tools/POSIX.py
+++ b/src/lib/Client/Tools/POSIX.py
@@ -18,6 +18,7 @@ import string
import time
import Bcfg2.Client.Tools
import Bcfg2.Options
+from Bcfg2.Client import XML
log = logging.getLogger('posix')
@@ -219,6 +220,7 @@ class POSIX(Bcfg2.Client.Tools.Tool):
nqtext += "Directory %s contains extra entries:" % entry.get('name')
nqtext += ":".join(ex_ents)
entry.set('qtest', nqtext)
+ [entry.append(XML.Element('Prune', path=x)) for x in ex_ents]
except OSError:
ex_ents = []
pruneTrue = True
@@ -321,7 +323,8 @@ class POSIX(Bcfg2.Client.Tools.Tool):
(entry.get('name')))
return False
if entry.get('prune', 'false') == 'true' and entry.get("qtest"):
- for pname in entry.get("qtest").split(":"):
+ for pent in entry.findall('Prune'):
+ pname = pent.get('path')
ulfailed = False
if os.path.isdir(pname):
self.logger.info("Not removing extra directory %s, please check and remove manually" % pname)