From 970fd5d2891f59c7ac3943d8c50715badbd1047c Mon Sep 17 00:00:00 2001 From: Daniel Black Date: Thu, 12 Dec 2013 08:52:01 +0000 Subject: [PATCH] BF: ensure dangling symlink error message is reachable $ ls -la /tmp/f2b-tempq0ipGY/f2 lrwxrwxrwx. 1 dan dan 11 Dec 12 08:42 /tmp/f2b-tempq0ipGY/f2 -> nonexisting In [3]: os.path.exists('/tmp/f2b-tempq0ipGY/f2') Out[3]: False In [4]: os.path.lexists('/tmp/f2b-tempq0ipGY/f2') Out[4]: True --- client/jailreader.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/client/jailreader.py b/client/jailreader.py index 7fbac423..8980431e 100644 --- a/client/jailreader.py +++ b/client/jailreader.py @@ -65,9 +65,10 @@ class JailReader(ConfigReader): pathList = [] for p in glob.glob(path): if not os.path.exists(p): - logSys.warning("File %s doesn't even exist, thus cannot be monitored" % p) - elif not os.path.lexists(p): - logSys.warning("File %s is a dangling link, thus cannot be monitored" % p) + if os.path.lexists(p): + logSys.warning("File %s is a dangling link, thus cannot be monitored" % p) + else: + logSys.warning("File %s doesn't even exist, thus cannot be monitored" % p) else: pathList.append(p) return pathList