diff --git a/compile_server/app/checker.py b/compile_server/app/checker.py index 2780561..cebce87 100644 --- a/compile_server/app/checker.py +++ b/compile_server/app/checker.py @@ -222,22 +222,18 @@ def run_program(request): return CrossDomainResponse(result) # Run the command(s) to check the program + run_cmd = "python /workspace/run.py /workspace/sessions/{} {}".format( + os.path.basename(tempd), mode) + if 'lab' in received_json: lab = received_json['lab'] - commands = [ + run_cmd += " {}".format(lab) + + commands = [ # Run the program ["lxc", "exec", "safecontainer", "--", "su", "runner", "-c", - "python /workspace/run.py /workspace/sessions/{} {} {}".format( - os.path.basename(tempd), mode, lab)] - ] - else: - commands = [ - # Run the program - ["lxc", "exec", "safecontainer", "--", "su", "runner", - "-c", - "python /workspace/run.py /workspace/sessions/{} {}".format( - os.path.basename(tempd), mode)] + run_cmd] ] print "\n".join(" ".join(c) for c in commands)