Change in vdsm[master]: storageServer: Add log when isSession fails.

mlipchuk at redhat.com mlipchuk at redhat.com
Tue Feb 10 23:33:56 UTC 2015


Maor Lipchuk has uploaded a new change for review.

Change subject: storageServer:  Add log when isSession fails.
......................................................................

storageServer:  Add log when isSession fails.

When we call isSession function and get a false return, we can't really
indicate what is the reason it failed in the log.

For example, when we want to disconnect from a target session which is part
of an iSCSI bond, the session will be defined with an interface of eth0,
while the engine will try, by mistake, to disconnect the session with a
default interface.
this kind of engine bugs might happen from time to time, and the better
the log will be detailed it will be more easy to catch the bug.

Signed-off-by: Maor Lipchuk <mlipchuk at redhat.com>
Change-Id: I82e84fdf4a4be2b70ccb304159c705197869cc51
---
M vdsm/storage/storageServer.py
1 file changed, 6 insertions(+), 0 deletions(-)


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

diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py
index 76c043c..dcaa74d 100644
--- a/vdsm/storage/storageServer.py
+++ b/vdsm/storage/storageServer.py
@@ -344,6 +344,7 @@
 
 
 class IscsiConnection(object):
+    log = logging.getLogger("Storage.StorageServer.IscsiConnection")
     @property
     def target(self):
         return self._target
@@ -383,18 +384,23 @@
                 return False
 
         if self._target.portal.port != portal.port:
+            self.log.info("isSession returned false for session %d since the target port does not match session port (%d vs %d)", session.id, self._target.portal.port, portal.port)
             return False
 
         if self._target.tpgt is not None and self._target.tpgt != target.tpgt:
+            self.log.info("isSession returned false for session %d since the target tpqt does not match session tpqt (%d vs %d)", session.id, self._target.tpgt, target.tpgt)
             return False
 
         if self._target.iqn != target.iqn:
+            self.log.info("isSession returned false for session %d since the target iqn does not match session iqn (%s vs %s)", session.id, self._target.iqn != target.iqn)
             return False
 
         if self._iface.name != iface.name:
+            self.log.info("isSession returned false for session %d since the target iface name does not match session iface name (%s vs %s)", session.id, self._iface.name, iface.name)
             return False
 
         if self._cred != cred:
+            self.log.info("isSession returned false for session %d since the target cred does not match session cred (%s vs %s)", session.id, self._cred, cred)
             return False
 
         return True


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I82e84fdf4a4be2b70ccb304159c705197869cc51
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Maor Lipchuk <mlipchuk at redhat.com>


More information about the vdsm-patches mailing list