Skip to content

Commit 1b02171

Browse files
author
Alexandre Germain
committed
lint & unnest
Signed-off-by: Alexandre Germain <[email protected]>
1 parent cb66956 commit 1b02171

File tree

1 file changed

+9
-11
lines changed

1 file changed

+9
-11
lines changed

podman_compose.py

+9-11
Original file line numberDiff line numberDiff line change
@@ -996,17 +996,15 @@ async def container_to_args(compose, cnt, detached=True):
996996
if is_str(env_file):
997997
env_file = [env_file]
998998
for i in env_file:
999-
if is_dict(i):
1000-
path = i['path']
1001-
required = i.get('required', True)
1002-
i = os.path.realpath(os.path.join(dirname, path))
1003-
if not os.path.exists(i):
1004-
if required:
1005-
raise ValueError("Env file at {} does not exist".format(i))
1006-
else:
1007-
continue
1008-
else:
1009-
i = os.path.realpath(os.path.join(dirname, i))
999+
if is_str(i):
1000+
i = {"path": i}
1001+
path = i['path']
1002+
required = i.get('required', True)
1003+
i = os.path.realpath(os.path.join(dirname, path))
1004+
if not os.path.exists(i):
1005+
if not required:
1006+
continue
1007+
raise ValueError("Env file at {} does not exist".format(i))
10101008
podman_args.extend(["--env-file", i])
10111009
env = norm_as_list(cnt.get("environment", {}))
10121010
for e in env:

0 commit comments

Comments
 (0)