2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

python.ovs.db.idl: Fix Row.delete() of a row already committed to the db.

Row.delete() handled the case of deleting a row that was added within the
current transaction, but not yet committed, but it did not correctly handle
the case of deleting a row that belonged to the database before the
transaction started.  This fixes the problem.

Reported-by: Yeming Zhao <zhaoyeming@gmail.com>
Tested-by: Yeming Zhao <zhaoyeming@gmail.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2013-04-08 10:44:40 -07:00
parent ed87900d26
commit 8d3efc1c0e
2 changed files with 4 additions and 1 deletions

View File

@@ -1,4 +1,4 @@
# Copyright (c) 2009, 2010, 2011, 2012 Nicira, Inc.
# Copyright (c) 2009, 2010, 2011, 2012, 2013 Nicira, Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -610,6 +610,8 @@ class Row(object):
assert self._changes is not None
if self._data is None:
del self._idl.txn._txn_rows[self.uuid]
else:
self._idl.txn._txn_rows[self.uuid] = self
self.__dict__["_changes"] = None
del self._table.rows[self.uuid]