Merge "Run mlock_report under python3"

This commit is contained in:
Jenkins 2017-04-03 13:41:55 +00:00 committed by Gerrit Code Review
commit ee71ae03f6
2 changed files with 7 additions and 4 deletions

@ -14,6 +14,8 @@
set -o errexit set -o errexit
PYTHON=${PYTHON:-python}
# time to sleep between checks # time to sleep between checks
SLEEP_TIME=20 SLEEP_TIME=20
@ -86,7 +88,7 @@ function tracker {
# list processes that lock memory from swap # list processes that lock memory from swap
if [[ $unevictable -ne $unevictable_point ]]; then if [[ $unevictable -ne $unevictable_point ]]; then
unevictable_point=$unevictable unevictable_point=$unevictable
./tools/mlock_report.py ${PYTHON} ./tools/mlock_report.py
fi fi
echo "]]]" echo "]]]"

@ -8,14 +8,15 @@ import subprocess
import psutil import psutil
SUMMARY_REGEX = re.compile(r".*\s+(?P<locked>[\d]+)\s+KB") SUMMARY_REGEX = re.compile(b".*\s+(?P<locked>[\d]+)\s+KB")
def main(): def main():
try: try:
print _get_report() print(_get_report())
except Exception as e: except Exception as e:
print "Failure listing processes locking memory: %s" % str(e) print("Failure listing processes locking memory: %s" % str(e))
raise
def _get_report(): def _get_report():