Yeela Kaplan has uploaded a new change for review.

Change subject: Implement rest of os and os.path functionality
......................................................................

Implement rest of os and os.path functionality

Change-Id: Ic4476982ba0125f8b1d8466f5f5809a0e9464cf5
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1083771
Signed-off-by: Yeela Kaplan <[email protected]>
---
M vdsm/storage/outOfProcess.py
1 file changed, 18 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/82/27482/1

diff --git a/vdsm/storage/outOfProcess.py b/vdsm/storage/outOfProcess.py
index 7b6d2a3..f6fad22 100644
--- a/vdsm/storage/outOfProcess.py
+++ b/vdsm/storage/outOfProcess.py
@@ -21,6 +21,7 @@
 import os
 import errno
 import logging
+import stat
 
 from vdsm.config import config
 import threading
@@ -93,6 +94,7 @@
 class _IOProcessOs(object):
     def __init__(self, iop):
         self._iop = iop
+        self.path = _IOProcessOs.Path(iop)
 
     def chmod(self, path, mode):
         self._iop.chmod(path, mode)
@@ -102,6 +104,20 @@
 
     def statvfs(self, path):
         return self._iop.statvfs(path)
+
+    def unlink(self, path):
+        return self._iop.unlink(path)
+
+    class Path(object):
+        def __init__(self, iop):
+            self._iop = iop
+
+        def isdir(self, path):
+            res = self._iop.stat(path)
+            return res.st_mode and stat.S_IFDIR
+
+        def lexists(self, path):
+            return self._iop.lexists(path)
 
 
 def directReadLines(ioproc, path):
@@ -142,6 +158,8 @@
             self.os.chmod = _IOProcessOs(ioproc).chmod
             self.os.statvfs = _IOProcessOs(ioproc).statvfs
             self.os.rename = _IOProcessOs(ioproc).rename
+            self.os.unlink = _IOProcessOs(ioproc).unlink
+            self.os.path = _IOProcessOs(ioproc).path
             self.directReadLines = partial(directReadLines, ioproc)
             self.writeLines = partial(writeLines, ioproc)
 


-- 
To view, visit http://gerrit.ovirt.org/27482
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic4476982ba0125f8b1d8466f5f5809a0e9464cf5
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to