[node-patches] Change in ovirt-node[ovirt-3.5]: Syntax fixes for kdump in mount.umount and Transaction

fabiand at redhat.com fabiand at redhat.com
Thu Dec 4 15:52:19 UTC 2014


Hello Ryan Barry,

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

    http://gerrit.ovirt.org/35888

to review the following change.

Change subject: Syntax fixes for kdump in mount.umount and Transaction
......................................................................

Syntax fixes for kdump in mount.umount and Transaction

Add .insert to transaction instead of just .append, which doesn't
seem to have been there previously.

Use LOGGER instead of self.logger for mount.umount

Change-Id: Ia5c2b46836188d7b8355df31982b0e133cfb80dc
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=1095140
Signed-off-by: Ryan Barry <rbarry at redhat.com>
---
M src/ovirt/node/utils/__init__.py
M src/ovirt/node/utils/system.py
2 files changed, 13 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-node refs/changes/88/35888/1

diff --git a/src/ovirt/node/utils/__init__.py b/src/ovirt/node/utils/__init__.py
index 3c014e7..7356b73 100644
--- a/src/ovirt/node/utils/__init__.py
+++ b/src/ovirt/node/utils/__init__.py
@@ -319,6 +319,9 @@
     def append(self, value):
         self.elements.append(value)
 
+    def insert(self, pos, value):
+        self.elements.insert(pos, value)
+
     def extend(self, iterable):
         self.elements.extend(iterable)
 
diff --git a/src/ovirt/node/utils/system.py b/src/ovirt/node/utils/system.py
index c6e54b6..3a6f2bf 100644
--- a/src/ovirt/node/utils/system.py
+++ b/src/ovirt/node/utils/system.py
@@ -898,7 +898,7 @@
 
     def remount(self, rw=False):
         if not os.path.ismount(self.path):
-            self.logger.exception("%s is not a mount point" % self.path)
+            LOGGER.exception("%s is not a mount point" % self.path)
             raise RuntimeError("%s is not a mount point" % self.path)
 
         # EL6 won't let you remount if it's not in mtab or fstab
@@ -912,12 +912,12 @@
                 utils.process.check_call(["mount", "-o", "ro,remount",
                                           device, self.path])
         except:
-            self.logger.exception("Can't remount %s on %s!" % (device,
-                                                               self.path))
+            LOGGER.exception("Can't remount %s on %s!" % (device,
+                                                          self.path))
 
     def mount(self):
         if not self.device:
-            self.logger.exception("Can't mount without a device specified")
+            LOGGER.exception("Can't mount without a device specified")
             raise RuntimeError("No device was specified when Mount() "
                                "was initialized")
 
@@ -927,12 +927,12 @@
             utils.process.check_call(["mount", "-t", fstype,
                                       self.device, self.path])
         except:
-            self.logger.exception("Can't mount %s on %s" % (self.device,
-                                  self.path))
+            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")
+        if not self.path:
+            LOGGER.exception("Can't umount without a path specified")
             raise RuntimeError("No path was specified when Mount() "
                                "was initialized")
 
@@ -940,8 +940,8 @@
             utils.process.check_call(["umount", self.path])
 
         except:
-            self.logger.exception("Can't umount %s" % self.path,
-                                  exc_info=True)
+            LOGGER.exception("Can't umount %s" % self.path,
+                             exc_info=True)
 
     def _find_device(self):
         try:


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia5c2b46836188d7b8355df31982b0e133cfb80dc
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