Return ENOENT if a file doesn't exist for readlink.
[invirt/packages/python-routefs.git] / routefs / __init__.py
index 5f3b4c4..875345b 100644 (file)
@@ -148,7 +148,9 @@ class RouteFS(fuse.Fuse):
         If the path specified is a symlink, return the target
         """
         obj = self._get_file(path)
-        if type(obj) is not Symlink:
+        if obj is None:
+            return -errno.ENOENT
+        elif type(obj) is not Symlink:
             return -errno.EINVAL
         else:
             return obj