From 36b0aed03a4d06bceb0869176eb351aae83991ae Mon Sep 17 00:00:00 2001 From: Ondra Machacek Date: Mon, 29 Oct 2018 12:49:58 +0100 Subject: [PATCH] ovirt_host_network: Fix type conversion (#47617) Signed-off-by: Ondra Machacek --- .../fragments/ovirt_host_network_fix_type_conversion.yaml | 2 ++ lib/ansible/modules/cloud/ovirt/ovirt_host_network.py | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) create mode 100644 changelogs/fragments/ovirt_host_network_fix_type_conversion.yaml diff --git a/changelogs/fragments/ovirt_host_network_fix_type_conversion.yaml b/changelogs/fragments/ovirt_host_network_fix_type_conversion.yaml new file mode 100644 index 0000000000..85bf0f4b2b --- /dev/null +++ b/changelogs/fragments/ovirt_host_network_fix_type_conversion.yaml @@ -0,0 +1,2 @@ +bugfixes: + - ovirt_host_network - Fix type conversion (https://github.com/ansible/ansible/pull/47617). diff --git a/lib/ansible/modules/cloud/ovirt/ovirt_host_network.py b/lib/ansible/modules/cloud/ovirt/ovirt_host_network.py index 49681fcba4..7a655c8745 100644 --- a/lib/ansible/modules/cloud/ovirt/ovirt_host_network.py +++ b/lib/ansible/modules/cloud/ovirt/ovirt_host_network.py @@ -221,12 +221,12 @@ def get_bond_options(mode, usr_opts): ) ) - opts_dict = DEFAULT_MODE_OPTS.get(mode, {}) + opts_dict = DEFAULT_MODE_OPTS.get(str(mode), {}) if usr_opts is not None: opts_dict.update(**usr_opts) options.extend( - [otypes.Option(name=opt, value=value) + [otypes.Option(name=opt, value=str(value)) for opt, value in six.iteritems(opts_dict)] ) return options