Move login command inside try so we clear env correctly

pull/1421/head
YuviPanda 2025-02-28 15:07:43 -08:00
rodzic d3facba5fb
commit 342eea96a8
1 zmienionych plików z 12 dodań i 12 usunięć

Wyświetl plik

@ -190,7 +190,8 @@ class DockerEngine(ContainerEngine):
shutil.copy2(dc_path, new_dc_path) shutil.copy2(dc_path, new_dc_path)
os.environ["DOCKER_CONFIG"] = d os.environ["DOCKER_CONFIG"] = d
proc = subprocess.run( try:
subprocess.run(
[ [
"docker", "docker",
"login", "login",
@ -202,7 +203,6 @@ class DockerEngine(ContainerEngine):
input=password.encode(), input=password.encode(),
check=True, check=True,
) )
try:
yield yield
finally: finally:
if old_dc_path: if old_dc_path: