Change in vdsm[master]: Adding utils package to outOfProcess

ybronhei at redhat.com ybronhei at redhat.com
Mon Apr 29 14:09:12 UTC 2013


Yaniv Bronhaim has uploaded a new change for review.

Change subject: Adding utils package to outOfProcess
......................................................................

Adding utils package to outOfProcess

Change-Id: I59d258b58a18aa187eb2b723aa018e22432d61d3
Signed-off-by: Yaniv Bronhaim <ybronhei at redhat.com>
---
M tests/outOfProcessTests.py
M vdsm/storage/outOfProcess.py
M vdsm/storage/remoteFileHandler.py
3 files changed, 11 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/25/14325/1

diff --git a/tests/outOfProcessTests.py b/tests/outOfProcessTests.py
index 3a4fb78..61a08cf 100644
--- a/tests/outOfProcessTests.py
+++ b/tests/outOfProcessTests.py
@@ -21,6 +21,7 @@
 from testrunner import VdsmTestCase as TestCaseBase
 import storage.outOfProcess as oop
 import os
+import tempfile
 
 
 class OopWrapperTests(TestCaseBase):
@@ -47,3 +48,9 @@
 
     def testModuleCall(self):
         self.assertNotEquals(self.pool.os.getpid(), os.getpid())
+
+    def testUtilsFuncs(self):
+        tmpfd, tmpfile = tempfile.mkstemp()
+        self.pool.utils.rmFile(tmpfile)
+        os.close(tmpfd)
+        return True
diff --git a/vdsm/storage/outOfProcess.py b/vdsm/storage/outOfProcess.py
index a445435..bf61d54 100644
--- a/vdsm/storage/outOfProcess.py
+++ b/vdsm/storage/outOfProcess.py
@@ -82,6 +82,6 @@
     return _ModuleWrapper("oop", procPool, DEFAULT_TIMEOUT,
                           (("os",
                             ("path",)),
-                           ("vdsm", ("utils",)),
                            "glob",
-                           "fileUtils"))
+                           "fileUtils",
+                           "utils"))
diff --git a/vdsm/storage/remoteFileHandler.py b/vdsm/storage/remoteFileHandler.py
index 8c6130a..3d26a9f 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -30,6 +30,7 @@
 import sys
 import select
 from contextlib import contextmanager
+from vdsm import utils
 
 if __name__ != "__main__":
     # If you don't have the vdsm package installed this will fail. Luckily we
@@ -404,7 +405,7 @@
 
                 server.registerFunction(func)
 
-            for mod in (os, glob, fileUtils):
+            for mod in (os, glob, fileUtils, utils):
                 server.registerModule(mod)
         except Exception:
             logging.root.error("Error creating CrabRPC server", exc_info=True)


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I59d258b58a18aa187eb2b723aa018e22432d61d3
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yaniv Bronhaim <ybronhei at redhat.com>


More information about the vdsm-patches mailing list