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 Jan 2, 2024
1 parent 14a5f7d commit 0b9945d
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("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 {
Expand Down

0 comments on commit 0b9945d

Please sign in to comment.