20
20
from __future__ import annotations
21
21
22
22
import errno
23
+ import logging
23
24
import os
24
25
import pty
25
26
import re
28
29
import subprocess
29
30
import sys
30
31
import time
31
- import warnings
32
32
33
33
from dataclasses import dataclass
34
34
from pathlib import Path
47
47
48
48
49
49
FIXTURES_DIR = Path (__file__ ).parent / "fixtures"
50
+ LOGGER = logging .getLogger (__name__ )
50
51
51
52
52
53
@dataclass
@@ -301,7 +302,7 @@ def _start_container() -> None:
301
302
302
303
if "podman" in INFRASTRUCTURE .container_engine :
303
304
cmd = BASE_CMD + PODMAN_CMD + auth_mount + END
304
- warnings . warn ("Podman auth mount added: " + auth_mount , stacklevel = 0 )
305
+ LOGGER . warning ("Podman auth mount added: %s" , auth_mount )
305
306
elif "docker" in INFRASTRUCTURE .container_engine :
306
307
cmd = BASE_CMD + DOCKER_CMD + END
307
308
else :
@@ -313,7 +314,7 @@ def _start_container() -> None:
313
314
container_name = INFRASTRUCTURE .container_name ,
314
315
image_name = INFRASTRUCTURE .image_name ,
315
316
)
316
- warnings . warn ("Running: " + cmd , stacklevel = 0 )
317
+ LOGGER . warning ("Running: %s" , cmd )
317
318
try :
318
319
subprocess .run (cmd , check = True , capture_output = True , shell = True , text = True )
319
320
except subprocess .CalledProcessError as exc :
@@ -332,7 +333,7 @@ def _start_container() -> None:
332
333
else :
333
334
nav_ee = get_nav_default_ee_in_container ()
334
335
warning = f"localhost / . not in image name, pulling default { nav_ee } for navigator"
335
- warnings . warn (warning , stacklevel = 0 )
336
+ LOGGER . warning (warning )
336
337
INFRASTRUCTURE .navigator_ee = nav_ee
337
338
_proc = _exec_container (command = f"podman pull { nav_ee } " )
338
339
0 commit comments