Skip to content

Commit

Permalink
cli:apply: Ignore udevadm errors triggering devices (LP: #2095203) (#539
Browse files Browse the repository at this point in the history
)

* udevadm: Ignore errors triggering devices

Fixes LP: #2095203

Signed-off-by: Wesley Hershberger <[email protected]>
  • Loading branch information
MggMuggins authored Feb 5, 2025
1 parent 5845bab commit 03e60e5
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion netplan_cli/cli/commands/apply.py
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,13 @@ def command_apply(self, run_generate=True, sync=False, exit_on_error=True, state
stderr=subprocess.DEVNULL)

subprocess.check_call(['udevadm', 'control', '--reload'])
subprocess.check_call(['udevadm', 'trigger', '--action=move', '--subsystem-match=net', '--settle'])

try:
subprocess.check_call(['udevadm', 'trigger', '--action=move', '--subsystem-match=net', '--settle'])
except subprocess.CalledProcessError as e:
# udevadm trigger returns 1 if it cannot trigger devices since
# systemd v248, e.g. in containers (LP: #2095203)
logging.warning('Ignoring device trigger error: {}'.format(e))

# apply any SR-IOV related changes, if applicable
NetplanApply.process_sriov_config(config_manager, exit_on_error)
Expand Down

0 comments on commit 03e60e5

Please sign in to comment.