Page MenuHomeVyOS Platform

remove duplication
Closed, ResolvedPublic

Description

vyos.validate.is_addr_assigned() and vyos.operational.Operational. configured_ips() are providing similar feature.
One should be kept.

configured_ips() allows to return all IPs and exclude some interface from the enumeration. It could be used to improve list_interfaces.py to not return the IP of the interface configured (this already has a task for it).

This is to discuss which one should go ;-)

Details

Difficulty level
Unknown (require assessment)
Version
-
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)

Event Timeline

I prefer the first one as it is proven to work since VyOS 1.2.x

First, I thought you had merged the patch, as you did not, there is no duplication ATM.

I think both have different use cases, there is still a need to be able to list all the IP on the system (for example for the completion) and this is where it should be and be used. I will update the patch to use check but would like to keep the code. is_addr_assigned can check netmask also. So one is great to use for source-IP (as it can exclude the current interface) and one to check if an IP/CIDR exists.

Just to make sure you disagree with me :-D I will just point that I rewrote is_addr_assigned - and did cause breakage doing so :-( - as it was not handling IPv6 as should previously. 🙊

thomas-mangin claimed this task.