Dan Kenigsberg has submitted this change and it was merged.

Change subject: ksm: janitorial: with construct, file() to open()
......................................................................


ksm: janitorial: with construct, file() to open()

Summary: use open() and with wherever feasible.

Details:
- move from file() to open(), as the direct usage of file()
  is deprecated:
  http://docs.python.org/2/library/functions.html#file
  http://docs.python.org/release/3.0/whatsnew/3.0.html#builtins
- use the with construct wherever possible, with files and
  threading.Locks
  
http://docs.python.org/2/library/threading.html#using-locks-conditions-and-semaphores-in-the-with-statement
- factor the code which read the procfs entries in a couple
  of helper functions, and a few tests for them.

PatchSet V2:
- moved tests into specific file ksmTests.py.
- used more specific check assertGreater insted of generic assertTrue.

PatchSet V3:
- registered ksmTests.py in Makefiles
- fix pep8 in ksmTests.py
- in KsmMonitorThread.adjust there is no need to call running() with
  lock held.

PatchSet V4:
- revert to assertTrue in tests, because more specific asserts require
  python 2.7; EL6 is python 2.6.

PatchSet V5:
- keep the tests ordered.

Change-Id: I47213b3d85eac9afd4cb316c50b192b9c1dfbbd8
Signed-off-by: Francesco Romani <[email protected]>
Reviewed-on: http://gerrit.ovirt.org/22084
Reviewed-by: Dan Kenigsberg <[email protected]>
Reviewed-by: Antoni Segura Puimedon <[email protected]>
---
M tests/Makefile.am
A tests/ksmTests.py
M vdsm/ksm.py
3 files changed, 59 insertions(+), 18 deletions(-)

Approvals:
  Antoni Segura Puimedon: Looks good to me, but someone else must approve
  Dan Kenigsberg: Looks good to me, approved
  Francesco Romani: Verified



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

Gerrit-MessageType: merged
Gerrit-Change-Id: I47213b3d85eac9afd4cb316c50b192b9c1dfbbd8
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Francesco Romani <[email protected]>
Gerrit-Reviewer: Antoni Segura Puimedon <[email protected]>
Gerrit-Reviewer: Dan Kenigsberg <[email protected]>
Gerrit-Reviewer: Francesco Romani <[email protected]>
Gerrit-Reviewer: Yaniv Bronhaim <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to