mirror of
https://github.com/ansible-collections/community.docker.git
synced 2026-07-29 11:55:04 +00:00
Fix docker_plugin crash when handling plugin options (#447)
* Fix docker_plugin crash when handling plugin options. * Try to add tests.
This commit is contained in:
@@ -245,7 +245,7 @@ class DockerPluginManager(object):
|
||||
self.existing_plugin = self.client.get_json('/plugins/{0}/json', self.preferred_name)
|
||||
if self.parameters.plugin_options:
|
||||
data = prepare_options(self.parameters.plugin_options)
|
||||
self.client.post_json('/plugins/{0}/set', self.preferred_name, data=['{0}={1}'.format(k, v) for k, v in data.items()])
|
||||
self.client.post_json('/plugins/{0}/set', self.preferred_name, data=data)
|
||||
except APIError as e:
|
||||
self.client.fail(to_native(e))
|
||||
|
||||
@@ -271,7 +271,7 @@ class DockerPluginManager(object):
|
||||
if not self.check_mode:
|
||||
try:
|
||||
data = prepare_options(self.parameters.plugin_options)
|
||||
self.client.post_json('/plugins/{0}/set', self.preferred_name, data=['{0}={1}'.format(k, v) for k, v in data.items()])
|
||||
self.client.post_json('/plugins/{0}/set', self.preferred_name, data=data)
|
||||
except APIError as e:
|
||||
self.client.fail(to_native(e))
|
||||
self.actions.append("Updated plugin %s settings" % self.preferred_name)
|
||||
|
||||
Reference in New Issue
Block a user