XCVR not inserted should be managed as admin down interface.
Type of change
Bug fix (non-breaking change which fixes an issue)
New Behavior
When dealing with Cisco NX-OS, output for shutdown interface when SFP is not inserted is the following :
cisco# show interface brief
<...>
--------------------------------------------------------------------------------
Ethernet VLAN Type Mode Status Reason Speed Port
Interface Ch #
--------------------------------------------------------------------------------
Eth1/1 -- eth routed down XCVR not inserted auto(D) --
Eth1/2 -- eth routed down XCVR not inserted auto(D) --
Eth1/3 -- eth routed down XCVR not inserted auto(D) --
Eth1/4 -- eth routed down XCVR not inserted auto(D) --
Eth1/5 -- eth routed down XCVR not inserted auto(D) --
Eth1/6 -- eth routed down XCVR not inserted auto(D) --
Eth1/7 -- eth routed down XCVR not inserted auto(D) --
Eth1/8 -- eth routed down XCVR not inserted auto(D) --
Eth1/9 1 eth trunk up none 25G(D) 9
Eth1/10 -- eth routed up none 25G(D) --
Eth1/11 1 eth trunk up none 25G(D) --
Eth1/12 -- eth routed up none 25G(D) --
Even if the interface is in shutdown adminState.
...
Contrast to Current Behavior
In the following line, this is considered as if the link is not connected, even if the interface is set to shutdown state.
if entry['reason'] in ["link not connected",
"xcvr not inserted"]:
entry['state'] = 'notConnected'
Creating a specific case for the entry reason "xcvr not inserted" to change adminState to down:
if entry['reason'] == "xcvr not inserted":
entry['state'] = 'notConnected'
entry['adminState'] = 'down'
Discussion: Benefits and Drawbacks
It will help to show interfaces really down, as an interface with no XCVR is by default shutdown.
Changes to the Documentation
None
Proposed Release Note Entry
Consider NX-OS interface with Reason 'XCVR not inserted' as adminState=down
...
Comments
None
Double Check
[X ] I have read the comments and followed the CONTRIBUTING.md.
[X] I have explained my PR according to the information in the comments or in a linked issue.
[X] My PR source branch is created from the develop branch.
Related Issue
Fixes #930
Description
XCVR not inserted
should be managed as admin down interface.Type of change
New Behavior
When dealing with Cisco NX-OS, output for shutdown interface when SFP is not inserted is the following :
Even if the interface is in shutdown adminState.
...
Contrast to Current Behavior
In the following line, this is considered as if the link is not connected, even if the interface is set to shutdown state.
Creating a specific case for the entry reason "xcvr not inserted" to change adminState to down:
Discussion: Benefits and Drawbacks
It will help to show interfaces really down, as an interface with no XCVR is by default shutdown.
Changes to the Documentation
None
Proposed Release Note Entry
Consider NX-OS interface with Reason 'XCVR not inserted' as adminState=down ...
Comments
None
Double Check
develop
branch.develop
branch.--signoff
applied