docker_image: fix default handling of old docker-build options nocache and rm (#56610)
* Fix usage of nocache parameter. * Fix defaults. * Add changelog.
This commit is contained in:
parent
1b66a13186
commit
56e2d48612
2 changed files with 6 additions and 3 deletions
|
@ -0,0 +1,3 @@
|
|||
bugfixes:
|
||||
- "docker_image - if ``nocache`` set to ``yes`` but not ``build.nocache``, the module failed."
|
||||
- "docker_image - if ``build`` was not specified, the wrong default for ``build.rm`` is used."
|
|
@ -453,11 +453,11 @@ class ImageManager(DockerBaseClass):
|
|||
self.load_path = parameters.get('load_path')
|
||||
self.name = parameters.get('name')
|
||||
self.network = build.get('network')
|
||||
self.nocache = build.get('nocache')
|
||||
self.nocache = build.get('nocache', False)
|
||||
self.build_path = build.get('path')
|
||||
self.pull = build.get('pull')
|
||||
self.repository = parameters.get('repository')
|
||||
self.rm = build.get('rm')
|
||||
self.rm = build.get('rm', True)
|
||||
self.state = parameters.get('state')
|
||||
self.tag = parameters.get('tag')
|
||||
self.http_timeout = build.get('http_timeout')
|
||||
|
@ -879,7 +879,7 @@ def main():
|
|||
if client.module.params[option] != default_value:
|
||||
if client.module.params['build'] is None:
|
||||
client.module.params['build'] = dict()
|
||||
if client.module.params['build'].get(build_option) != default_value:
|
||||
if client.module.params['build'].get(build_option, default_value) != default_value:
|
||||
client.fail('Cannot specify both %s and build.%s!' % (option, build_option))
|
||||
client.module.params['build'][build_option] = client.module.params[option]
|
||||
client.module.warn('Please specify build.%s instead of %s. The %s option '
|
||||
|
|
Loading…
Reference in a new issue