From 0b9945d1441b5a463137004aa287b0ad61149a82 Mon Sep 17 00:00:00 2001 From: Abdul Karim Date: Fri, 15 Dec 2023 16:24:34 +0000 Subject: [PATCH] ncm-network: nmstate - down the interface connection before applying nmstatectl apply does not replace running config instead it seems to append. This is not useful when settings have been removed such as policy routing. Therefore down the interface connection during configuration changes. This will be now similar to original main ncm network module where it runs ifdown and ifup during config changes. --- ncm-network/src/main/perl/nmstate.pm | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ncm-network/src/main/perl/nmstate.pm b/ncm-network/src/main/perl/nmstate.pm index d2be9ef2b2..ad95af4f6e 100644 --- a/ncm-network/src/main/perl/nmstate.pm +++ b/ncm-network/src/main/perl/nmstate.pm @@ -518,6 +518,8 @@ sub nmstate_apply # apply config using nmstatectl my $ymlfile = $self->iface_filename($iface); if ($self->any_exists($ymlfile)){ + $self->verbose("Applying config for interface $iface"); + push(@cmds, [$NMCLI_CMD, "conn", "down", $iface ]) if $self->is_active_interface($iface); push(@cmds, [$NMSTATECTL, "apply", $ymlfile]); push(@cmds, [qw(sleep 10)]) if ($iface =~ m/bond/); } else {