[dhcp_relay] Only call 'wait_until_iface_ready' once for each interface #3317
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
[dhcp_relay]'wait_for_init.sh.j2' translate duplicate if the interface has both ipv4 and ipv6 address #3316
Signed-off-by: wangshengjun wangshengjun@asterfusion.com
- What I did
When the interface has configured both ipv4 and ipv6 address, the 'wait_until_iface_ready' function called twice .So the j2 template of 'wait_for_init.sh.j2' was changed to fix the problem.
- How I did it
- How to verify it
1.configure the interface with both ipv4 and ipv6 addresses.
part of config file
....
"PORTCHANNEL_INTERFACE": {
"PortChannel0001": {},
"PortChannel0002": {},
"PortChannel0001|10.0.0.56/31": {},
"PortChannel0001|FC00::71/126": {},
"PortChannel0002|10.0.0.58/31": {},
"PortChannel0002|FC00::75/126": {}
},
...
2.check the 'wait_for_init.sh' translated by 'wait_for_init.sh.j2' according to the configuration.
function wait_until_iface_ready
{
.....
}
Wait for all interfaces to be up and ready
wait_until_iface_ready ${LAG_TABLE_PREFIX} PortChannel0001
wait_until_iface_ready ${LAG_TABLE_PREFIX} PortChannel0002
The 'wait_until_iface_ready' function should call once for each interface.