From: Ben Pfaff Date: Mon, 8 Apr 2013 17:44:40 +0000 (-0700) Subject: python.ovs.db.idl: Fix Row.delete() of a row already committed to the db. X-Git-Tag: sliver-openvswitch-1.10.90-3~17^2~101 X-Git-Url: http://git.onelab.eu/?a=commitdiff_plain;ds=sidebyside;h=8d3efc1c0ef61d395573b173fea9e5e5f4e30bc3;p=sliver-openvswitch.git 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 Tested-by: Yeming Zhao Signed-off-by: Ben Pfaff --- diff --git a/AUTHORS b/AUTHORS index 2ca0c2bca..68bcf015e 100644 --- a/AUTHORS +++ b/AUTHORS @@ -197,6 +197,7 @@ Vishal Swarankar vishal.swarnkar@gmail.com Vjekoslav Brajkovic balkan@cs.washington.edu Voravit T. voravit@kth.se YAMAMOTO Takashi yamamoto@valinux.co.jp +Yeming Zhao zhaoyeming@gmail.com Yongqiang Liu liuyq7809@gmail.com kk yap yapkke@stanford.edu likunyun kunyunli@hotmail.com diff --git a/python/ovs/db/idl.py b/python/ovs/db/idl.py index 9e9bf0f5d..55fbcba4b 100644 --- a/python/ovs/db/idl.py +++ b/python/ovs/db/idl.py @@ -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]