Skip to content

Commit

Permalink
ncm-network: nmstate - down the interface connection before applying
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Abdul Karim authored and Abdul Karim committed Dec 29, 2023
1 parent 14a5f7d commit 834c8da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ncm-network/src/main/perl/nmstate.pm
Original file line number Diff line number Diff line change
Expand Up @@ -518,6 +518,8 @@ sub nmstate_apply
# apply config using nmstatectl
my $ymlfile = $self->iface_filename($iface);
if ($self->any_exists($ymlfile)){
$self->verbose("Apply config for inteface $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 {
Expand Down

0 comments on commit 834c8da

Please sign in to comment.