Skip to content

Commit

Permalink
fix(net): Make duplicate route add succeed. (#5343)
Browse files Browse the repository at this point in the history
This behaves the same but doesn't fail when adding an existing route.

Fixes GH-3441
Fixes GH-3595
  • Loading branch information
holmanb authored May 29, 2024
1 parent 00ab328 commit e432a31
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cloudinit/net/netops/iproute2.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def add_route(
"ip",
"-4",
"route",
"add",
"replace",
route,
*gateway_args,
"dev",
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/net/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -1031,7 +1031,7 @@ def test_ephemeral_ipv4_network_with_new_default_route(self, m_subp):
"ip",
"-4",
"route",
"add",
"replace",
"192.168.2.1",
"dev",
"eth0",
Expand All @@ -1044,7 +1044,7 @@ def test_ephemeral_ipv4_network_with_new_default_route(self, m_subp):
"ip",
"-4",
"route",
"add",
"replace",
"default",
"via",
"192.168.2.1",
Expand Down

0 comments on commit e432a31

Please sign in to comment.