mirror of
https://github.com/containers/podman-compose.git
synced 2025-01-23 14:28:46 +01:00
#34: fix attribute error, fallback to none
This commit is contained in:
parent
2246204a52
commit
7bc6782e0d
@ -817,7 +817,7 @@ def compose_push(compose, args):
|
|||||||
|
|
||||||
def build_one(compose, args, cnt):
|
def build_one(compose, args, cnt):
|
||||||
if 'build' not in cnt: return
|
if 'build' not in cnt: return
|
||||||
if getattr(args, 'if_not_exists'):
|
if getattr(args, 'if_not_exists', None):
|
||||||
try: img_id = compose.podman.output(['inspect', '-t', 'image', '-f', '{{.Id}}', cnt["image"]])
|
try: img_id = compose.podman.output(['inspect', '-t', 'image', '-f', '{{.Id}}', cnt["image"]])
|
||||||
except subprocess.CalledProcessError: img_id = None
|
except subprocess.CalledProcessError: img_id = None
|
||||||
if img_id: return
|
if img_id: return
|
||||||
@ -834,8 +834,8 @@ def build_one(compose, args, cnt):
|
|||||||
"build", "-t", cnt["image"],
|
"build", "-t", cnt["image"],
|
||||||
"-f", dockerfile
|
"-f", dockerfile
|
||||||
]
|
]
|
||||||
if getattr(args, 'pull_always'): build_args.append("--pull-always")
|
if getattr(args, 'pull_always', None): build_args.append("--pull-always")
|
||||||
elif getattr(args, 'pull'): build_args.append("--pull")
|
elif getattr(args, 'pull', None): build_args.append("--pull")
|
||||||
args_list = norm_as_list(build_desc.get('args', {}))
|
args_list = norm_as_list(build_desc.get('args', {}))
|
||||||
for build_arg in args_list:
|
for build_arg in args_list:
|
||||||
build_args.extend(("--build-arg", build_arg,))
|
build_args.extend(("--build-arg", build_arg,))
|
||||||
|
Loading…
Reference in New Issue
Block a user