Skip to content

Commit

Permalink
fix(netops): fix ip addr flush command (canonical#5651)
Browse files Browse the repository at this point in the history
Drop unnecessary environment variable.

Fixes canonicalGH-5648
  • Loading branch information
holmanb authored and blackboxsw committed Sep 4, 2024
1 parent 10449cb commit 6963dcc
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 7 deletions.
3 changes: 1 addition & 2 deletions cloudinit/net/netops/iproute2.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,6 @@ def add_addr(
"dev",
interface,
],
update_env={"LANG": "C"},
)

@staticmethod
Expand All @@ -141,4 +140,4 @@ def del_addr(interface: str, address: str):

@staticmethod
def flush_addr(interface: str):
subp.subp(["ip", "flush", "dev", interface])
subp.subp(["ip", "addr", "flush", "dev", interface])
5 changes: 0 additions & 5 deletions tests/unittests/net/test_init.py
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,6 @@ def test_ephemeral_ipv4_network_performs_teardown(self, m_subp):
"dev",
"eth0",
],
update_env={"LANG": "C"},
),
]
expected_teardown_calls = [
Expand Down Expand Up @@ -973,7 +972,6 @@ def test_ephemeral_ipv4_network_with_prefix(self, m_subp):
"dev",
"eth0",
],
update_env={"LANG": "C"},
)
]
)
Expand All @@ -992,7 +990,6 @@ def test_ephemeral_ipv4_network_with_prefix(self, m_subp):
"dev",
"eth0",
],
update_env={"LANG": "C"},
)
]
)
Expand Down Expand Up @@ -1023,7 +1020,6 @@ def test_ephemeral_ipv4_network_with_new_default_route(self, m_subp):
"dev",
"eth0",
],
update_env={"LANG": "C"},
),
mock.call(["ip", "route", "show", "0.0.0.0/0"]),
mock.call(
Expand Down Expand Up @@ -1104,7 +1100,6 @@ def test_ephemeral_ipv4_network_with_rfc3442_static_routes(self, m_subp):
"dev",
"eth0",
],
update_env={"LANG": "C"},
),
mock.call(
[
Expand Down

0 comments on commit 6963dcc

Please sign in to comment.