Reviewed: https://review.openstack.org/358101 Committed: https://git.openstack.org/cgit/openstack/neutron/commit/?id=1f4f806584585e4bed02ec7ef784f57e11b05994 Submitter: Jenkins Branch: master
commit 1f4f806584585e4bed02ec7ef784f57e11b05994 Author: Terry Wilson <[email protected]> Date: Sat Aug 20 00:24:15 2016 -0500 Handle uuid references within an ovsdb transaction Enable the OVSDB API implementations to handle referencing a newly created object within the same transaction. For vsctl, this is via the --id=@name construct. For native, this is via storing the created row as the result, then replacing the result when the transaction completes. This uses an api.Command object passed as part of a column value in a db_set/db_create operation as a reference to that object in a transaction. For example, do: with self.ovsdb.transaction() as txn: queue = txn.add(self.ovsdb.db_create("Queue", ...)) qos = txn.add(self.ovsdb.db_create("QoS", queues={0: queue})) port = txn.add(self.ovsdb.db_set("Port", pname, ('qos', qos))) instead of having to do 5 separate transactions to: create a queue, find the queue, create the QoS entry, find the QoS entry, and finally to update the port with the QoS entry. Change-Id: I1781794958af1483dabc0f5d17f2df6fea828564 Closes-Bug: #1615105 ** Changed in: neutron Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to neutron. https://bugs.launchpad.net/bugs/1615105 Title: ovsdb's db_create results not uniform across vsctl and native implementations Status in neutron: Fix Released Bug description: The OVSDB native and vsctl implementations return different types of results for db_create(). The native implementation returns a Row() object, which is specific to using OVS's python library. The vsctl implementation returns a string representation of the created uuid. Even with --format=json, the returned result is not JSON. To be uniform, both implementations should return a uuid.UUID object representing the uuid assigned to the newly inserted row. The db_create call isn't currently used by neutron, but patch https://review.openstack.org/#/c/341186/ makes use of it. To manage notifications about this bug go to: https://bugs.launchpad.net/neutron/+bug/1615105/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : [email protected] Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp

