Skip to content

Commit

Permalink
iproute: fix flush_addr()
Browse files Browse the repository at this point in the history
Don't fail on automatically removed secondaries.
  • Loading branch information
svinota committed Jan 8, 2025
1 parent 05ada93 commit 7d5d40e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pyroute2/iproute/linux.py
Original file line number Diff line number Diff line change
Expand Up @@ -906,7 +906,11 @@ async def flush_addr(self, *argv, **kwarg):
}
)
for addr in work:
ret.extend(await self.addr('del', **addr))
try:
ret.extend(await self.addr('del', **addr))
except NetlinkError:
if not ret:
raise
return ret

async def flush_rules(self, *argv, **kwarg):
Expand Down

0 comments on commit 7d5d40e

Please sign in to comment.