quattor / configuration-modules-core

Node Configuration Manager Components for Everyone
www.quattor.org
Other
6 stars 54 forks source link

ncm-network: nmstate dgw fix #1656

Closed aka7 closed 5 months ago

aka7 commented 6 months ago

Fix for setting default gateway in nmstate with correct interface by looking up if gateway falls within subnet boundary. next-hop-interface is mandatory for nmstate therefore figure out which interface subnet this gateway falls in. This will provide backward compatibility with network.pm

closes #1655

wdpypere commented 6 months ago

@aka7 thanks for the quick work. I can confirm this code now does to default gateways what I would expect!

aka7 commented 6 months ago

@aka7 thanks for the quick work. I can confirm this code now does to default gateways what I would expect!

thanks for confirming, I've opened this PR for review now. I think this will be better then what I had before as I assumed every interface will have gateway defined.

Also bear in mind, nmstate module does not provide all functionalities currently provided by network.pm, as many of comments in the nmstate.pm states. @wdpypere

stdweird commented 5 months ago

@aka7 can you also have a look at this?