From a0a421bf5e8beaebc83e8df98694d3a92e42efa8 Mon Sep 17 00:00:00 2001 From: Anders Kaseorg Date: Sun, 30 Aug 2020 15:41:41 -0700 Subject: [PATCH] Revert "Merge pull request #96152 from JJJollyjim/colour-test-machines-staging" MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 1bff6fe17cbf3e81fbd4122af41d77ea378f45d7, reversing changes made to 2995fa48cb4878756b9d64b27535737278d96f07. There’s presumably nothing wrong with this PR, except that it conflicts with reverting #96254 which broke several tests (#96699). Signed-off-by: Anders Kaseorg --- nixos/lib/test-driver/test-driver.py | 15 ++------------- 1 file changed, 2 insertions(+), 13 deletions(-) diff --git a/nixos/lib/test-driver/test-driver.py b/nixos/lib/test-driver/test-driver.py index 612bb02aaa9..65a44be6468 100644 --- a/nixos/lib/test-driver/test-driver.py +++ b/nixos/lib/test-driver/test-driver.py @@ -3,7 +3,6 @@ import argparse import atexit import base64 import io -import itertools import logging import os import pathlib @@ -93,17 +92,10 @@ logging.basicConfig(format="%(message)s") logger = logging.getLogger("test-driver") logger.setLevel(logging.INFO) -machine_colours_iter = ( - "\x1b[{}m".format(x) for x in itertools.cycle(reversed(range(31, 37))) -) - class MachineLogAdapter(logging.LoggerAdapter): def process(self, msg: str, kwargs: Any) -> Tuple[str, Any]: - return ( - f"{self.extra['colour_code']}{self.extra['machine']}\x1b[39m: {msg}", - kwargs, - ) + return f"{self.extra['machine']}: {msg}", kwargs def make_command(args: list) -> str: @@ -180,10 +172,7 @@ class Machine: self.socket = None self.monitor: Optional[socket.socket] = None self.allow_reboot = args.get("allowReboot", False) - self.logger = MachineLogAdapter( - logger, - extra=dict(machine=self.name, colour_code=next(machine_colours_iter)), - ) + self.logger = MachineLogAdapter(logger, extra=dict(machine=self.name)) @staticmethod def create_startcommand(args: Dict[str, str]) -> str: