[pre-commit.ci] auto fixes from pre-commit.com hooks

for more information, see https://pre-commit.ci
pull/1421/head
pre-commit-ci[bot] 2025-02-26 21:00:17 +00:00
rodzic 268e18765b
commit 3bdc004e46
1 zmienionych plików z 6 dodań i 5 usunięć

Wyświetl plik

@ -176,8 +176,9 @@ class DockerEngine(ContainerEngine):
# whatever configuration the user has already set # whatever configuration the user has already set
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([ proc = subprocess.run(
[
"docker", "docker",
"login", "login",
"--username", "--username",
@ -186,15 +187,15 @@ class DockerEngine(ContainerEngine):
registry, registry,
], ],
input=password.encode(), input=password.encode(),
check=True check=True,
) )
try: try:
yield yield
finally: finally:
if old_dc_path: if old_dc_path:
os.environ['DOCKER_CONFIG'] = old_dc_path os.environ["DOCKER_CONFIG"] = old_dc_path
else: else:
del os.environ['DOCKER_CONFIG'] del os.environ["DOCKER_CONFIG"]
def push(self, image_spec): def push(self, image_spec):
if self.registry_credentials: if self.registry_credentials: