Revision 26f15862 lib/backend.py
b/lib/backend.py | ||
---|---|---|
691 | 691 |
logging.error("os create command '%s' returned error: %s, logfile: %s," |
692 | 692 |
" output: %s", result.cmd, result.fail_reason, logfile, |
693 | 693 |
result.output) |
694 |
lines = [val.encode("string_escape")
|
|
694 |
lines = [utils.SafeEncode(val)
|
|
695 | 695 |
for val in utils.TailFile(logfile, lines=20)] |
696 | 696 |
return (False, "OS create script failed (%s), last lines in the" |
697 | 697 |
" log file:\n%s" % (result.fail_reason, "\n".join(lines))) |
... | ... | |
725 | 725 |
if result.failed: |
726 | 726 |
logging.error("os create command '%s' returned error: %s output: %s", |
727 | 727 |
result.cmd, result.fail_reason, result.output) |
728 |
lines = [val.encode("string_escape")
|
|
728 |
lines = [utils.SafeEncode(val)
|
|
729 | 729 |
for val in utils.TailFile(logfile, lines=20)] |
730 | 730 |
return (False, "OS rename script failed (%s), last lines in the" |
731 | 731 |
" log file:\n%s" % (result.fail_reason, "\n".join(lines))) |
... | ... | |
2434 | 2434 |
#logging.exception("Error while closing fd %s", fd) |
2435 | 2435 |
pass |
2436 | 2436 |
|
2437 |
return result == 0, output
|
|
2437 |
return result == 0, utils.SafeEncode(output.strip())
|
|
2438 | 2438 |
|
2439 | 2439 |
def RunHooks(self, hpath, phase, env): |
2440 | 2440 |
"""Run the scripts in the hooks directory. |
Also available in: Unified diff