Closed gjim83 closed 7 years ago
@gjim83 This looks good...do you have any handy test data (so I can add this to the unit tests):
command = 'show ip interface brief'
show_command = "show run interface {0}".format(interface)
cmd = "show interface {} | in Internet address is".format(interface)
It would be good to get the output of the above three commands with one normal interface and one in the DHCP state.
sure, will post some soon
@ktbyers DHCP interface:
FOO-RT01#sh run int GigabitEthernet0
Building configuration...
Current configuration : 95 bytes
!
interface GigabitEthernet0
vrf forwarding Mgmt-intf
ip address dhcp
negotiation auto
end
FOO-RT01#show interface GigabitEthernet0 | in Internet address is
FOO-RT01#
Usual manual config:
FOO-RT01#sh run interface GigabitEthernet0/0/0
Building configuration...
Current configuration : 274 bytes
!
interface GigabitEthernet0/0/0
description Primary Connection to FOO-RS01 G1/0/1
backup interface Vlan200
ip address 172.29.91.82 255.255.255.240
no ip redirects
no ip proxy-arp
ip flow monitor MONITOR1 input
ip flow monitor MONITOR1 output
negotiation auto
end
FOO-RT01#show interface GigabitEthernet0/0/0 | in Internet address is
Internet address is 172.29.91.82/28
FOO-RT01
FOO-RT01#sh ip int br
Interface IP-Address OK? Method Status Protocol
GigabitEthernet0/0/0 172.29.91.82 YES NVRAM up up
GigabitEthernet0/0/1 unassigned YES NVRAM administratively down down
GigabitEthernet0/0/2 10.63.54.190 YES NVRAM up up
GigabitEthernet0/0/3 10.240.25.121 YES NVRAM up up
GigabitEthernet0/3/0 unassigned YES unset up up
GigabitEthernet0/3/1 unassigned YES unset administratively down down
GigabitEthernet0/3/2 unassigned YES unset administratively down down
GigabitEthernet0/3/3 unassigned YES unset administratively down down
GigabitEthernet0/3/4 unassigned YES unset administratively down down
GigabitEthernet0/3/5 unassigned YES unset administratively down down
GigabitEthernet0/3/6 unassigned YES unset administratively down down
GigabitEthernet0/3/7 unassigned YES unset administratively down down
ucse1/0/0 unassigned YES NVRAM administratively down down
ucse1/0/1 unassigned YES NVRAM administratively down down
GigabitEthernet0 unassigned YES NVRAM down down
Loopback0 172.29.1.81 YES NVRAM up up
Tunnel30522 172.29.67.166 YES NVRAM up up
Vlan1 unassigned YES NVRAM administratively down down
Vlan200 172.29.91.82 YES NVRAM standby mode down
Btw, thos UCS blades interfaces also cause another issue when parsing, that I will soon post a PR about.
@ktbyers is this okay to include it into 0.8.0?
When an interface is set to take its IP from DHCP, but is shut down, an exception will get raised because this command will return no output since there's no IP address but then the code will try to
split
the output and get some of the list elements.The result is: