can't abort transaction if creation failed
This commit is contained in:
parent
a89e884b75
commit
3d74447fd9
@ -91,8 +91,8 @@ class NFTSocket(pyroute2.netlink.nlsocket.NetlinkSocket):
|
||||
|
||||
@contextlib.contextmanager
|
||||
def begin(self) -> typing.Generator[NFTTransaction, None, None]:
|
||||
tx = NFTTransaction(socket=self)
|
||||
try:
|
||||
tx = NFTTransaction(socket=self)
|
||||
yield tx
|
||||
# autocommit when no exception was raised
|
||||
# (only commits if it wasn't aborted)
|
||||
|
Loading…
Reference in New Issue
Block a user