docker_image: Fix missing exc in except, pass proper args to docker.build

This commit is contained in:
Erik Johnson 2017-12-15 09:33:12 -06:00
parent f311c6a700
commit 76a7c0b593
No known key found for this signature in database
GPG Key ID: 5E5583C437808F3F

View File

@ -258,7 +258,8 @@ def present(name,
try:
# map values passed from the state to the build args
build_args['path'] = build
build_args['image'] = full_image
build_args['repository'] = name
build_args['tag'] = tag
build_args['dockerfile'] = dockerfile
image_update = __salt__['docker.build'](**build_args)
except Exception as exc:
@ -325,7 +326,7 @@ def present(name,
try:
__salt__['docker.inspect_image'](full_image)
error = False
except CommandExecutionError:
except CommandExecutionError as exc:
msg = exc.__str__()
if '404' not in msg:
error = 'Failed to inspect image \'{0}\' after it was {1}: {2}'.format(