From 54e0b2aa304a8a93c8140e5aa73798613f8daf6b Mon Sep 17 00:00:00 2001 From: Nilashish Chakraborty Date: Mon, 30 Dec 2019 13:12:16 +0530 Subject: [PATCH] Make autocost bandwidth calculation a floor division for Py3 compatibility (#66095) Signed-off-by: NilashishC (cherry picked from commit 06927eab1f80fd86c7f9ef86b5656fcba6fa3ee2) Add changelog for nxos_ospf_vrf fix Signed-off-by: NilashishC --- changelogs/fragments/66095_fix_nxos_ospf_vrf.yaml | 3 +++ lib/ansible/modules/network/nxos/nxos_ospf_vrf.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) create mode 100644 changelogs/fragments/66095_fix_nxos_ospf_vrf.yaml diff --git a/changelogs/fragments/66095_fix_nxos_ospf_vrf.yaml b/changelogs/fragments/66095_fix_nxos_ospf_vrf.yaml new file mode 100644 index 00000000000..3b9ef3d8cfa --- /dev/null +++ b/changelogs/fragments/66095_fix_nxos_ospf_vrf.yaml @@ -0,0 +1,3 @@ +--- +bugfixes: + - Fix bandwidth calculation in nxos_ospf_vrf for Python 3 (https://github.com/ansible/ansible/pull/66095) diff --git a/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py b/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py index 60a3e6348dc..5dea537dba6 100644 --- a/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py +++ b/lib/ansible/modules/network/nxos/nxos_ospf_vrf.py @@ -299,7 +299,7 @@ def state_present(module, existing, proposed, candidate): if len(value) < 5: command = '{0} {1} Mbps'.format(key, value) else: - value = str(int(value) / 1000) + value = str(int(value) // 1000) command = '{0} {1} Gbps'.format(key, value) elif key == 'bfd': command = 'no bfd' if value == 'disable' else 'bfd'