From e70e0569ec24047966925bbba6fda2109f66624e Mon Sep 17 00:00:00 2001 From: Steven Armstrong Date: Thu, 13 Oct 2011 18:01:46 +0200 Subject: [PATCH] FileList handle exception when deleting old/unused file Signed-off-by: Steven Armstrong --- lib/cdist/util/fsproperty.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/cdist/util/fsproperty.py b/lib/cdist/util/fsproperty.py index e441533a..cfdb007e 100644 --- a/lib/cdist/util/fsproperty.py +++ b/lib/cdist/util/fsproperty.py @@ -43,7 +43,11 @@ class FileList(collections.MutableSequence): self.path = path if initial: # delete existing file - os.unlink(self.path) + try: + os.unlink(self.path) + except EnvironmentError: + # ignored + pass for i in initial: self.append(i)