[improvement] Magpie fails to detect primary interface (IndexError: list index out of range)
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
charm-magpie |
New
|
Undecided
|
Unassigned |
Bug Description
Hello,
When deploying to BGP networks with BIRD, magpie attempts to detect the primary interface with routes. This breaks the magpie logic as there are lines such as this:
ip route (actual CIDRs removed)
0.0.0.0/1 proto bird
nexthop via x.x.x.x dev ens2f0np0 weight 1
nexthop via y.y.y.1 dev ens2f1np1 weight 1
default via x.x.x.1 dev ens2f1np1
default via y.y.y.1 dev eno1 proto dhcp src z.z.z.17 metric 100
x,x,x,0/24 dev ens2f0np0 proto kernel scope link src x.x.x.17
y.y.y.0/24 dev ens2f1np1 proto kernel scope link src y.y.y.17
128.0.0.0/1 proto bird
nexthop via x.x.x.1 dev ens2f0np0 weight 1
nexthop via y.y.y.1 dev ens2f1np1 weight 1
u.u.u.u/24 via y.y.y.1 dev eno1
y.y.y.y via u.u.u.1 dev eno1 proto dhcp src u.u.u.17 metric 100
u.u.u.u via u.u.u.1 dev eno1 proto dhcp src u.u.u.17 metric 100
u.u.u.u via u.u.u.1 dev eno1 proto dhcp src u.u.u.17 metric 100
u.u.u.u via u.u.u.1 dev eno1 proto dhcp src u.u.u.17 metric 100
u.u.u.0/24 via u.u.u.1 dev eno1
u.u.u.0/24 dev eno1 proto kernel scope link src u.u.u.17 metric 100
u.u.u.1 dev eno1 proto dhcp scope link src u.u.u.17 metric 100
This happens due to this logic:
def check_nodes(nodes, iperf_client=
cfg = hookenv.config()
local_ip = hookenv.
iface_lines = subprocess.
iface_lines = iface_lines.
for line in iface_lines:
if re.match('.* via .*', line) is None:
break
primary_iface = str(line)
This will throw the error in the title: IndexError: list index out of range)
This bug is just to document this limitation/
Thanks,
Peter
tags: | added: bgp |
merge opened here: https:/ /review. opendev. org/c/openstack /charm- magpie/ +/881697