Skip to content

Commit

Permalink
apply: stop flushing addresses when NM is used
Browse files Browse the repository at this point in the history
With the introduction of keep-configuration it shouldn't be necessary
anymore.
  • Loading branch information
daniloegea committed Sep 17, 2024
1 parent f0f5d69 commit 3f2b33d
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions netplan_cli/cli/commands/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -290,11 +290,7 @@ def command_apply(self, run_generate=True, sync=False, exit_on_error=True, state
# 2nd: start all other services
utils.systemctl('start', netplan_wpa + netplan_ovs, sync=True)
if restart_nm:
# Flush all IP addresses of NM managed interfaces, to avoid NM creating
# new, non netplan-* connection profiles, using the existing IPs.
nm_interfaces = utils.nm_interfaces(restart_nm_glob, devices)
for iface in nm_interfaces:
utils.ip_addr_flush(iface)
# clear NM state, especially the [device].managed=true config, as that might have been
# re-set via an udev rule setting "NM_UNMANAGED=1"
shutil.rmtree('/run/NetworkManager/devices', ignore_errors=True)
Expand Down

0 comments on commit 3f2b33d

Please sign in to comment.