Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix nxos_ospf_vrf python3 compatibility issue #58888

Open
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
4 participants
@jlothian
Copy link
Contributor

commented Jul 9, 2019

Make sure division results in an integer since NXOS can't
handle a floating point value for the auto-cost reference-bandwidth

SUMMARY

In python 3, the / operator yields a float even when both operands are ints. When python3 is used as the interpreter, the module will fail when trying to set the auto-cost reference bandwidth:

fatal: [switchname]: FAILED! => {"changed": false, "msg": "auto-cost reference-bandwidth 100.0 Gbps\r\r\n ^\r\n% Invalid number at '^' marker.\r\n\switchname(config-router)# "}

This patch implements the python3 '//' operator for integer floor division

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

nxos

ADDITIONAL INFORMATION

Create a simple play, and run with ansible_python_interpreter pointed at a python3 binary:
- name: Set up OSPF instance in vrfs
nxos_ospf_vrf:
auto_cost: 100000
passive_interface: true
ospf: 5
router_id: 169.254.0.1


Fix nxos_ospf_vrf python3 compatibility issue
Make sure division results in an integer since NXOS can't
handle a floating point value for the auto-cost reference-bandwidth
@ansibot

This comment has been minimized.

@ansibot

This comment has been minimized.

Copy link
Contributor

commented Jul 9, 2019

@jlothian, just so you are aware we have a dedicated Working Group for network.
You can find other people interested in this in #ansible-network on Freenode IRC
For more information about communities, meetings and agendas see https://github.com/ansible/community

click here for bot help

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.