summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2013-05-02 00:30:52 +0200
committerAlexander Sulfrian <alexander@sulfrian.net>2013-05-02 11:02:39 +0200
commit7077358b1a262e3db384eb3218628632d3a6cc31 (patch)
tree50d2c8c78f13d26ee8f5f88b5fd56e5da6e8ffc8
parent17e71a9d400c4f4a3cef6591f4864ae2ef6d96b1 (diff)
downloadbcfg2-7077358b1a262e3db384eb3218628632d3a6cc31.tar.gz
bcfg2-7077358b1a262e3db384eb3218628632d3a6cc31.tar.bz2
bcfg2-7077358b1a262e3db384eb3218628632d3a6cc31.zip
Client/Tools/POSIX: catch multiple VerifyDirectory callsdebian/1.2.3-11
If a directory should be pruned from all unknown files VerifyDirectory created a new entry each call and the second fails because the file was already removed.
-rw-r--r--debian/changelog3
-rw-r--r--src/lib/Client/Tools/POSIX.py4
2 files changed, 5 insertions, 2 deletions
diff --git a/debian/changelog b/debian/changelog
index 808e81e6a..8dd83c767 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,5 +1,6 @@
-bcfg2 (1.2.3-11) UNRELEASED; urgency=low
+bcfg2 (1.2.3-11) unstable; urgency=low
+ * Client/Tools/POSIX: catch multiple VerifyDirectory calls
* Reports/templates: mark hosts with extra packages in grid view
* Plugins/Packages/Portage: use keywords/use config everywhere
* Plugins/Packages/Layman: add support for layman overlays
diff --git a/src/lib/Client/Tools/POSIX.py b/src/lib/Client/Tools/POSIX.py
index 049b90d32..5e1507bbd 100644
--- a/src/lib/Client/Tools/POSIX.py
+++ b/src/lib/Client/Tools/POSIX.py
@@ -116,6 +116,7 @@ class POSIX(Bcfg2.Client.Tools.Tool):
setup.parse([])
ppath = setup['ppath']
max_copies = setup['max_copies']
+ prune_list = list()
def canInstall(self, entry):
"""Check if entry is complete for installation."""
@@ -304,7 +305,7 @@ class POSIX(Bcfg2.Client.Tools.Tool):
try:
entries = ['/'.join([entry.get('name'), ent]) \
for ent in os.listdir(entry.get('name'))]
- ex_ents = [e for e in entries if e not in modlist]
+ ex_ents = [e for e in entries if e not in modlist and e not in self.prune_list]
if ex_ents:
pruneTrue = False
self.logger.debug("Directory %s contains extra entries:" % \
@@ -317,6 +318,7 @@ class POSIX(Bcfg2.Client.Tools.Tool):
entry.set('qtest', nqtext)
[entry.append(XML.Element('Prune', path=x)) \
for x in ex_ents]
+ self.prune_list += ex_ents
except OSError:
ex_ents = []
pruneTrue = True