Change in vdsm[ovirt-3.5]: utils: Add memoized invalidation

fromani at redhat.com fromani at redhat.com
Tue Oct 20 08:43:41 UTC 2015


Francesco Romani has submitted this change and it was merged.

Change subject: utils: Add memoized invalidation
......................................................................


utils: Add memoized invalidation

We learned in the hard way that memoizing and monkey-patching do work
nicely together. However, disabling memoizing during the tests means
that we do not test the same code in the application.

This patch adds invalidate() method to memoized functions, so tests can
clean up properly after they modify memozied data.

This can also be used by application code to invalidate memoized
functions in certain conditions.

Change-Id: I3053b8ecc567f7c3154f7473dfd6b587823313ae
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Bug-Url: https://bugzilla.redhat.com/1267851
Reviewed-on: http://gerrit.ovirt.org/37788
Reviewed-by: Francesco Romani <fromani at redhat.com>
Reviewed-by: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/40029
Tested-by: Francesco Romani <fromani at redhat.com>
Continuous-Integration: Francesco Romani <fromani at redhat.com>
---
M lib/vdsm/utils.py
M tests/utilsTests.py
2 files changed, 67 insertions(+), 1 deletion(-)

Approvals:
  Piotr Kliczewski: Looks good to me, but someone else must approve
  Nir Soffer: Looks good to me, but someone else must approve
  Dan Kenigsberg: Looks good to me, approved
  Francesco Romani: Verified; Passed CI tests



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I3053b8ecc567f7c3154f7473dfd6b587823313ae
Gerrit-PatchSet: 5
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Francesco Romani <fromani at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Piotr Kliczewski <piotr.kliczewski at gmail.com>
Gerrit-Reviewer: automation at ovirt.org


More information about the vdsm-patches mailing list