From e16c81e8da864cedc0ae7d390baa2e9746bd720f Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Tue, 19 Feb 2019 00:01:20 +0800 Subject: [PATCH] actually use bz2 log compression properly --- extended-tests.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/extended-tests.py b/extended-tests.py index c53941d..d98e284 100644 --- a/extended-tests.py +++ b/extended-tests.py @@ -1,4 +1,5 @@ import json +import bz2 import sys with open(sys.argv[1], "r") as f: @@ -7,7 +8,7 @@ with open(sys.argv[1], "r") as f: drv = hydra_json["drvPath"] assert drv.startswith("/nix/store/") drv = drv[len("/nix/store/"):] -hydra_log = "/var/lib/hydra/build-logs/" + drv[:2] + "/" + drv[2:] +hydra_log = "/var/lib/hydra/build-logs/" + drv[:2] + "/" + drv[2:] + ".bz2" -with open(hydra_log, "w") as f: - f.write("hack successful") +with bz2.BZ2File(hydra_log, "w") as f: + f.write(b"hack successful")