The device_from_ip function doesn't properly detect vlan tagged interfaces - e.g. bond0.10 because ip a sh to will display <vlan tag interface>@<master interface>.