From e8d6645c54323283379433d8bfce7a4e84d0e305 Mon Sep 17 00:00:00 2001 From: anasbadaha <43231942+anasbadaha@users.noreply.github.com> Date: Fri, 2 Nov 2018 15:16:05 +0200 Subject: [PATCH] Issue 46477 Fix Module onyx interface for supporting new json changes (#46494) Signed-off-by: Anas Badaha --- lib/ansible/modules/network/onyx/onyx_interface.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/network/onyx/onyx_interface.py b/lib/ansible/modules/network/onyx/onyx_interface.py index 207fceef9ce..08bee3bbc55 100644 --- a/lib/ansible/modules/network/onyx/onyx_interface.py +++ b/lib/ansible/modules/network/onyx/onyx_interface.py @@ -81,7 +81,7 @@ EXAMPLES = """ onyx_interface: name: Eth1/2 description: test-interface - speed: 100 GB + speed: 100G mtu: 512 - name: make interface up @@ -346,9 +346,12 @@ class OnyxInterfaceModule(BaseOnyxModule): self._current_config[if_name] = self._create_if_data( if_name, if_data) else: + if_data = dict() for if_config in config: - for if_name, if_data in iteritems(if_config): - if_data = if_data[0] + for if_name, if_attr in iteritems(if_config): + for config in if_attr: + for key, value in iteritems(config): + if_data[key] = value self._current_config[if_name] = self._create_if_data( if_name, if_data)