You've already forked code_examples_server
mirror of
https://github.com/AdaCore/code_examples_server.git
synced 2026-02-12 12:45:18 -08:00
Refactoring some redundancies.
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user