[node-patches] Change in ovirt-node[ovirt-3.5]: Add Mount.umount

fabiand at redhat.com fabiand at redhat.com
Wed Nov 26 11:29:34 UTC 2014


Hello Ryan Barry,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/35590

to review the following change.

Change subject: Add Mount.umount
......................................................................

Add Mount.umount

Now we'll have remount, mount, and umount

Change-Id: I60d470832e92a916d7f23f52627dae1557f73dbc
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/utils/system.py
1 file changed, 13 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/90/35590/1

diff --git a/src/ovirt/node/utils/system.py b/src/ovirt/node/utils/system.py
index 406403f..c6e54b6 100644
--- a/src/ovirt/node/utils/system.py
+++ b/src/ovirt/node/utils/system.py
@@ -930,6 +930,19 @@
             self.logger.exception("Can't mount %s on %s" % (self.device,
                                   self.path))
 
+    def umount(self):
+        if not self.device:
+            self.logger.exception("Can't umount without a path specified")
+            raise RuntimeError("No path was specified when Mount() "
+                               "was initialized")
+
+        try:
+            utils.process.check_call(["umount", self.path])
+
+        except:
+            self.logger.exception("Can't umount %s" % self.path,
+                                  exc_info=True)
+
     def _find_device(self):
         try:
             return process.check_output(["findmnt", "-o", "SOURCE", "-n",


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I60d470832e92a916d7f23f52627dae1557f73dbc
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-node
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Fabian Deutsch <fabiand at redhat.com>
Gerrit-Reviewer: Ryan Barry <rbarry at redhat.com>



More information about the node-patches mailing list