Hello Petr Horáček, Dan Kenigsberg,

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

    https://gerrit.ovirt.org/64403

to review the following change.

Change subject: net: Bond - Add logging to the bond driver.
......................................................................

net: Bond - Add logging to the bond driver.

Change-Id: I043a6232d59cd87f6b973d856df297322f4be387
Bug-Url: https://bugzilla.redhat.com/1379115
Signed-off-by: Edward Haas <edwa...@redhat.com>
Reviewed-on: https://gerrit.ovirt.org/63444
Reviewed-by: Petr Horáček <phora...@redhat.com>
Continuous-Integration: Jenkins CI
Reviewed-by: Dan Kenigsberg <dan...@redhat.com>
---
M lib/vdsm/network/link/bond.py
1 file changed, 10 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/03/64403/1

diff --git a/lib/vdsm/network/link/bond.py b/lib/vdsm/network/link/bond.py
index 1a2b5d0..d91e496 100644
--- a/lib/vdsm/network/link/bond.py
+++ b/lib/vdsm/network/link/bond.py
@@ -19,6 +19,7 @@
 from __future__ import absolute_import
 
 import abc
+import logging
 import os
 import six
 
@@ -126,23 +127,29 @@
 
     def __exit__(self, ex_type, ex_value, traceback):
         if ex_type is not None:
+            logging.info('Bond {} transaction failed, reverting...'.format(
+                self._master))
             self._revert_transaction()
 
     def create(self):
         with open(self.BONDING_MASTERS, 'w') as f:
             f.write('+%s' % self._master)
+        logging.info('Bond {} has been created.'.format(self._master))
         if self._slaves:
             self.add_slaves(self._slaves)
 
     def destroy(self):
         with open(self.BONDING_MASTERS, 'w') as f:
             f.write('-%s' % self._master)
+        logging.info('Bond {} has been destroyed.'.format(self._master))
 
     def add_slaves(self, slaves):
         for slave in slaves:
             iface.down(slave)
             with open(self.BONDING_SLAVES % self._master, 'w') as f:
                 f.write('+%s' % slave)
+            logging.info('Slave {} has been added to bond {}.'.format(
+                slave, self._master))
             self._slaves.add(slave)
 
     def del_slaves(self, slaves):
@@ -150,6 +157,8 @@
             iface.down(slave)
             with open(self.BONDING_SLAVES % self._master, 'w') as f:
                 f.write('-%s' % slave)
+            logging.info('Slave {} has been removed from bond {}.'.format(
+                slave, self._master))
             self._slaves.remove(slave)
 
     def set_options(self, options):
@@ -157,6 +166,7 @@
         for key, value in options:
             with open(self.BONDING_OPT % (self._master, key), 'w') as f:
                 f.write(value)
+        logging.info('Bond {} options set: {}.'.format(self._master, options))
 
     def exists(self):
         return os.path.exists(self.BONDING_PATH % self._master)


-- 
To view, visit https://gerrit.ovirt.org/64403
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I043a6232d59cd87f6b973d856df297322f4be387
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-4.0
Gerrit-Owner: Edward Haas <edwa...@redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <dan...@redhat.com>
Gerrit-Reviewer: Petr Horáček <phora...@redhat.com>
_______________________________________________
vdsm-patches mailing list -- vdsm-patches@lists.fedorahosted.org
To unsubscribe send an email to vdsm-patches-le...@lists.fedorahosted.org

Reply via email to