Skip to content

Commit e576ebe

Browse files
authored
fix(lib): return success from maybe_reload_networkd when no reload is needed
maybe_reload_networkd runs under an EXIT trap with set -e. The branch that skips networkctl reload used `[ -v EC2_IF_INITIAL_SETUP ] && debug ...`. When EC2_IF_INITIAL_SETUP is unset (typical refresh runs), the test fails with status 1, the trap returns non-zero, and systemd reports failure even though setup-policy-routes completed successfully.
1 parent d9f01f3 commit e576ebe

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

lib/lib.sh

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -617,7 +617,9 @@ maybe_reload_networkd() {
617617
networkctl reload
618618
debug "Reloaded networkd"
619619
else
620-
[ -v EC2_IF_INITIAL_SETUP ] && debug "No networkd reload needed"
620+
if [ -v EC2_IF_INITIAL_SETUP ]; then
621+
debug "No networkd reload needed"
622+
fi
621623
fi
622624
else
623625
debug "Deferring networkd reload to another process"

0 commit comments

Comments
 (0)