Change in vdsm[master]: Allow configurators to be used as context managers

danken at redhat.com danken at redhat.com
Tue Aug 27 14:11:47 UTC 2013


Dan Kenigsberg has submitted this change and it was merged.

Change subject: Allow configurators to be used as context managers
......................................................................


Allow configurators to be used as context managers

Since configurators have commit and rollback, they are the perfect
candidate for being used as context managers.

Before:
    configurator = Ifcfg()
    try:
        b = Bond(bonding, configurator, options, nics,
                 mtu, NetInfo(), implicitBond).configure()
    except:
        configurator.rollback
        raise

After:
    with Ifcfg() as configurator:
        Bond(bonding, configurator, options, nics,
             mtu, NetInfo(), implicitBond).configure()

Change-Id: I2c07aa23d637ad3ae8a8b5ce455e67b163338ca8
Signed-off-by: Antoni S. Puimedon <asegurap at redhat.com>
Reviewed-on: http://gerrit.ovirt.org/18412
Reviewed-by: Assaf Muller <amuller at redhat.com>
Reviewed-by: Giuseppe Vallarelli <gvallare at redhat.com>
Reviewed-by: Mark Wu <wudxw at linux.vnet.ibm.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/configNetwork.py
M vdsm/netconf/__init__.py
M vdsm/netconf/ifcfg.py
3 files changed, 20 insertions(+), 21 deletions(-)

Approvals:
  Giuseppe Vallarelli: Looks good to me, but someone else must approve
  Antoni Segura Puimedon: Verified
  Mark Wu: Looks good to me, but someone else must approve
  Assaf Muller: Looks good to me, but someone else must approve
  Dan Kenigsberg: Looks good to me, approved



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2c07aa23d637ad3ae8a8b5ce455e67b163338ca8
Gerrit-PatchSet: 4
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Antoni Segura Puimedon <asegurap at redhat.com>
Gerrit-Reviewer: Assaf Muller <amuller at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Giuseppe Vallarelli <gvallare at redhat.com>
Gerrit-Reviewer: Mark Wu <wudxw at linux.vnet.ibm.com>
Gerrit-Reviewer: oVirt Jenkins CI Server


More information about the vdsm-patches mailing list