Skip to content

Commit

Permalink
Revert "Merge pull request NixOS#96152 from JJJollyjim/colour-test-ma…
Browse files Browse the repository at this point in the history
…chines-staging"

This reverts commit 1bff6fe, reversing
changes made to 2995fa4.

There’s presumably nothing wrong with this PR, except that it
conflicts with reverting NixOS#96254 which broke several tests (NixOS#96699).

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
  • Loading branch information
andersk committed Aug 30, 2020
1 parent b317137 commit a0a421b
Showing 1 changed file with 2 additions and 13 deletions.
15 changes: 2 additions & 13 deletions nixos/lib/test-driver/test-driver.py
Expand Up @@ -3,7 +3,6 @@
import atexit
import base64
import io
import itertools
import logging
import os
import pathlib
Expand Down Expand Up @@ -93,17 +92,10 @@
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:
Expand Down Expand Up @@ -180,10 +172,7 @@ def create_dir(name: str) -> str:
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:
Expand Down

0 comments on commit a0a421b

Please sign in to comment.