10 e.log.verbose("Sandbox running locally\n")
11 e.builtins.parse_line("BOXDIR=${HOME}/box")
12 e.builtins.parse_line("BOXEXE=${HOME}/bin/box")
14 e.log.verbose("Sandbox user: %s\n" % user);
15 e.builtins.parse_line("BOXDIR=${HOME}/box")
16 e.builtins.parse_line("BOXEXE=${HOME}/bin/box-" + user)
17 e.builtins.parse_line("BOXCMD=${BOXEXE} -c${BOXDIR}")
21 e.log.verbose("Sandbox directory: %s\n" % dir)
22 e.log.verbose("Sandbox command: %s\n" % cmd)
23 if dir == "" or not os.path.isdir(dir) or exe == "" or not os.path.isfile(exe):
24 raise moe.MoeError, "Sandbox set up incorrectly"
27 moe.util.remove_tree_contents(e["BOXDIR"])
34 if e.log.verbosity > 1:
35 e.log.verbose("Box contents for %s:\n" % msg)
37 os.system("ls -Al %s | sed 's/^/\t/'" % e["BOXDIR"])
39 def run(e, opts, cmd):
40 c = e["BOXCMD"] + " " + opts + " -- " + cmd
41 e.log.verbose("Sandbox: %s\n" % c)
45 rc = os.WEXITSTATUS(st)
47 raise moe.MoeError, "Sandbox failed with rc=%d" % rc
50 raise moe.MoeError, "Sandbox failed with exit status 0x%04x" % rc