docker_image: fix module failing when build option is used without specifying path (#56940)
* Fix module failing when build option is used without specifying path. * Add changelog.pull/4420/head
parent
56e2d48612
commit
86928a5f74
|
@ -0,0 +1,2 @@
|
||||||
|
bugfixes:
|
||||||
|
- "docker_image - module failed when ``source: build`` was set but ``build.path`` options not specified."
|
|
@ -886,7 +886,7 @@ def main():
|
||||||
'has been renamed and will be removed in Ansible 2.12.' % (build_option, option, option))
|
'has been renamed and will be removed in Ansible 2.12.' % (build_option, option, option))
|
||||||
if client.module.params['source'] == 'build':
|
if client.module.params['source'] == 'build':
|
||||||
if (not client.module.params['build'] or not client.module.params['build'].get('path')):
|
if (not client.module.params['build'] or not client.module.params['build'].get('path')):
|
||||||
client.module.fail('If "source" is set to "build", the "build.path" option must be specified.')
|
client.fail('If "source" is set to "build", the "build.path" option must be specified.')
|
||||||
if client.module.params['build'].get('pull') is None:
|
if client.module.params['build'].get('pull') is None:
|
||||||
client.module.warn("The default for build.pull is currently 'yes', but will be changed to 'no' in Ansible 2.12. "
|
client.module.warn("The default for build.pull is currently 'yes', but will be changed to 'no' in Ansible 2.12. "
|
||||||
"Please set build.pull explicitly to the value you need.")
|
"Please set build.pull explicitly to the value you need.")
|
||||||
|
|
Loading…
Reference in New Issue