Commit 0f071168 by brianhw

Merge pull request #10 from edx/fix/brian/remove_warning

Return log warning to debug level.
parents 0a1b468d d820e6c8
Ned Batchelder <ned@nedbatchelder.com>
Will Daly <will@edx.org>
Brian Wilson <brian@edx.org>
......@@ -152,7 +152,7 @@ def jail_code(command, code=None, files=None, argv=None, stdin=None,
with temp_directory() as tmpdir:
if slug:
log.warning("Executing jailed code %s in %s", slug, tmpdir)
log.debug("Executing jailed code %s in %s", slug, tmpdir)
argv = argv or []
......@@ -196,7 +196,7 @@ def jail_code(command, code=None, files=None, argv=None, stdin=None,
def set_process_limits(): # pragma: no cover
"""
Set limits on this processs, to be used first in a child process.
Set limits on this process, to be used first in a child process.
"""
# Set a new session id so that this process and all its children will be
# in a new process group, so we can kill them all later if we need to.
......@@ -239,6 +239,6 @@ class ProcessKillerThread(threading.Thread):
pgid = os.getpgid(self.subproc.pid)
log.warning(
"Killing process %r (group %r), ran too long: %.1fs",
self.subproc.pid, pgid, time.time()-start
self.subproc.pid, pgid, time.time() - start
)
subprocess.call(["sudo", "pkill", "-9", "-g", str(pgid)])
......@@ -222,7 +222,7 @@ if UNSAFE: # pragma: no cover
"""An actually-unsafe safe_exec, that warns it's being used."""
# Because it would be bad if this function were used in production,
# let's log a warning when it is used. Developers can can live with
# let's log a warning when it is used. Developers can live with
# one more log line.
slug = kwargs.get('slug', None)
log.warning("Using codejail/safe_exec.py:not_safe_exec for %s", slug)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment