)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"01ef6c529cfb296e678567480d076e21e98b8867","unresolved":false,"context_lines":[{"line_number":14,"context_line":"part of a column value in a db_set/db_create operation as a"},{"line_number":15,"context_line":"reference to that object in a transaction. For example, do:"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"with self.ovsdb.transaction() as txn:"},{"line_number":18,"context_line":"    queue \u003d txn.add(self.ovsdb.db_create(\"Queue\", ...))"},{"line_number":19,"context_line":"    qos \u003d txn.add(self.ovsdb.db_create(\"QoS\", queues\u003d{0: queue}))"},{"line_number":20,"context_line":"    port \u003d txn.add(self.ovsdb.db_set(\"Port\", pname, (\u0027qos\u0027, qos)))"},{"line_number":21,"context_line":""},{"line_number":22,"context_line":"instead of having to do 5 separate transactions to: create a"},{"line_number":23,"context_line":"queue, find the queue, create the QoS entry, find the QoS entry,"},{"line_number":24,"context_line":"and finally to update the port with the QoS entry."},{"line_number":25,"context_line":""},{"line_number":26,"context_line":"Change-Id: I1781794958af1483dabc0f5d17f2df6fea828564"},{"line_number":27,"context_line":"Closes-Bug: #1615105"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7a8ec9b2_ef05f7c1","line":24,"range":{"start_line":17,"start_character":0,"end_line":24,"end_character":50},"updated":"2016-09-22 02:13:00.000000000","message":"Awesome, I like this idea!! this convinces me and give me a feeling it\u0027s worth to give -1 in https://review.openstack.org/#/c/372849.\n\nI will try this for networking-ovn, hope this can make it better.","commit_id":"0de56ecd64666fa1c86c58f31fc2d5729fe90b1d"}],"neutron/agent/ovsdb/impl_idl.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"70c3ce3b68ede762f7929e48e284deba9d83a952","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        pass"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def post_commit(self, txn):"},{"line_number":84,"context_line":"        for command in self.commands:"},{"line_number":85,"context_line":"            command.post_commit(txn)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def do_commit(self):"},{"line_number":88,"context_line":"        self.start_time \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_da05bac2","line":85,"range":{"start_line":84,"start_character":0,"end_line":85,"end_character":36},"updated":"2016-08-22 09:12:06.000000000","message":"Just a question, no action required: Is this related to this patch or a followup for patch 11dc21d3 ?","commit_id":"6be4e86dc598e0a73ff6bba8a7e06f71d677846f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"82470b885aa6fda547e82f9629a782ef8c82100e","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        pass"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def post_commit(self, txn):"},{"line_number":84,"context_line":"        for command in self.commands:"},{"line_number":85,"context_line":"            command.post_commit(txn)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def do_commit(self):"},{"line_number":88,"context_line":"        self.start_time \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_e208bf2f","line":85,"range":{"start_line":84,"start_character":0,"end_line":85,"end_character":36},"in_reply_to":"1ac06dbe_31afc782","updated":"2016-08-22 14:03:22.000000000","message":"thanks for explanation.","commit_id":"6be4e86dc598e0a73ff6bba8a7e06f71d677846f"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"3bc09d656b5474897cc7597e1d30b2b6b95afee4","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        pass"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def post_commit(self, txn):"},{"line_number":84,"context_line":"        for command in self.commands:"},{"line_number":85,"context_line":"            command.post_commit(txn)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def do_commit(self):"},{"line_number":88,"context_line":"        self.start_time \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_31afc782","line":85,"range":{"start_line":84,"start_character":0,"end_line":85,"end_character":36},"in_reply_to":"1ac06dbe_da05bac2","updated":"2016-08-22 13:22:18.000000000","message":"This is completely this patch. The other patch was more transaction-level post-commit (like being able to ensure all interfaces for all ops and take a single action if any in the group fail). This is more about each individual command being able to add something post-commit (like get the the real UUID assigned after commit).","commit_id":"6be4e86dc598e0a73ff6bba8a7e06f71d677846f"},{"author":{"_account_id":13667,"name":"ZongKai LI","email":"onionpiece@163.com","username":"lzklibj"},"change_message_id":"01ef6c529cfb296e678567480d076e21e98b8867","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def post_commit(self, txn):"},{"line_number":84,"context_line":"        for command in self.commands:"},{"line_number":85,"context_line":"            command.post_commit(txn)"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":"    def do_commit(self):"},{"line_number":88,"context_line":"        self.start_time \u003d time.time()"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a8ec9b2_8f24730d","line":85,"updated":"2016-09-22 02:13:00.000000000","message":"post_commit is easy to align command behavior, and Transaction will no need to care commands results, let commands handle that by themselves. nice.","commit_id":"0de56ecd64666fa1c86c58f31fc2d5729fe90b1d"}],"neutron/agent/ovsdb/impl_vsctl.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a59406961145e43abf473ced5654ddc8eac205b5","unresolved":false,"context_lines":[{"line_number":154,"context_line":"    def __init__(self, context, opts\u003dNone, args\u003dNone):"},{"line_number":155,"context_line":"        super(DbCreateCommand, self).__init__(context, \"create\", opts, args)"},{"line_number":156,"context_line":"        # NOTE(twilson) pre-commit result used for intra-transaction reference"},{"line_number":157,"context_line":"        self.record_id \u003d \"@%s\" % uuid.uuid4()"},{"line_number":158,"context_line":"        self.opts.append(\"--id\u003d%s\" % self.record_id)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_e6e4763d","line":157,"range":{"start_line":157,"start_character":8,"end_line":157,"end_character":13},"updated":"2016-09-01 17:16:15.000000000","message":"Nit: Is it needed to be persistent or it\u0027s just to pass it to cli?","commit_id":"04200067e879216de52f815006a10fd56299a49b"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"cbaa83a644789bbc62897d4dabfcde90bef9ded6","unresolved":false,"context_lines":[{"line_number":154,"context_line":"    def __init__(self, context, opts\u003dNone, args\u003dNone):"},{"line_number":155,"context_line":"        super(DbCreateCommand, self).__init__(context, \"create\", opts, args)"},{"line_number":156,"context_line":"        # NOTE(twilson) pre-commit result used for intra-transaction reference"},{"line_number":157,"context_line":"        self.record_id \u003d \"@%s\" % uuid.uuid4()"},{"line_number":158,"context_line":"        self.opts.append(\"--id\u003d%s\" % self.record_id)"},{"line_number":159,"context_line":""},{"line_number":160,"context_line":"    @property"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_acdc0fe5","line":157,"range":{"start_line":157,"start_character":8,"end_line":157,"end_character":13},"in_reply_to":"fa7ab95a_e6e4763d","updated":"2016-09-01 18:15:25.000000000","message":"It needs to be passed to be passed to the CLI, but is done so via _set_colval_args/py_to_val from other Command objects, so I think it needs to be stored.","commit_id":"04200067e879216de52f815006a10fd56299a49b"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"790036d13908b6377a6e8b2d9532fb6f1b61882f","unresolved":false,"context_lines":[{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    @result.setter"},{"line_number":165,"context_line":"    def result(self, val):"},{"line_number":166,"context_line":"        self._result \u003d uuid.UUID(val) if val else val"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"class BrExistsCommand(DbCommand):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a8bc5a2_0f5388e2","line":166,"range":{"start_line":166,"start_character":8,"end_line":166,"end_character":53},"updated":"2016-09-22 18:37:11.000000000","message":"noob question: If I understood it correctly, `result` can be either UUID or \"\". Do you have tests for this?","commit_id":"0de56ecd64666fa1c86c58f31fc2d5729fe90b1d"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"fb65e32af13b45edf439c0d484d0e04b975c46a1","unresolved":false,"context_lines":[{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    @result.setter"},{"line_number":165,"context_line":"    def result(self, val):"},{"line_number":166,"context_line":"        self._result \u003d uuid.UUID(val) if val else val"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"class BrExistsCommand(DbCommand):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a8bc5a2_f66e0bc8","line":166,"range":{"start_line":166,"start_character":8,"end_line":166,"end_character":53},"in_reply_to":"5a8bc5a2_0f5388e2","updated":"2016-09-23 14:02:02.000000000","message":"result is initialized to None. This is just to make sure that we don\u0027t try to convert the initial None to a UUID.","commit_id":"0de56ecd64666fa1c86c58f31fc2d5729fe90b1d"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"070646313470d056cdb2df04b248f65fd6fd4a54","unresolved":false,"context_lines":[{"line_number":163,"context_line":""},{"line_number":164,"context_line":"    @result.setter"},{"line_number":165,"context_line":"    def result(self, val):"},{"line_number":166,"context_line":"        self._result \u003d uuid.UUID(val) if val else val"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"class BrExistsCommand(DbCommand):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a98d1f4_cb6c4c9f","line":166,"range":{"start_line":166,"start_character":8,"end_line":166,"end_character":53},"in_reply_to":"5a8bc5a2_f66e0bc8","updated":"2016-09-28 18:33:53.000000000","message":"OK, makes sense. Thanks.","commit_id":"0de56ecd64666fa1c86c58f31fc2d5729fe90b1d"}],"neutron/agent/ovsdb/native/idlutils.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"2996626ea6f3a9f739e3ceb3d0d2ecf555d31f2d","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        for k, v in six.iteritems(obj):"},{"line_number":245,"context_line":"            if isinstance(v, api.Command):"},{"line_number":246,"context_line":"                obj[k] \u003d v.result"},{"line_number":247,"context_line":"    elif (isinstance(obj, collections.Sequence)"},{"line_number":248,"context_line":"          and not isinstance(obj, six.string_types)):"},{"line_number":249,"context_line":"        for i, v in enumerate(obj):"},{"line_number":250,"context_line":"            if isinstance(v, api.Command):"},{"line_number":251,"context_line":"                obj[i] \u003d v.result"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_05b5fbec","line":248,"range":{"start_line":247,"start_character":9,"end_line":248,"end_character":52},"updated":"2016-08-27 09:21:21.000000000","message":"Any chance we could get a tuple here? If so, it will fail on L251 because you can\u0027t assign an object into a tuple.","commit_id":"5877ce0b18e0e49ce7a4476b5e26b9a72561ab20"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"9af804d4d3ae8245f92bf2e8d790309216078f07","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        for k, v in six.iteritems(obj):"},{"line_number":245,"context_line":"            if isinstance(v, api.Command):"},{"line_number":246,"context_line":"                obj[k] \u003d v.result"},{"line_number":247,"context_line":"    elif (isinstance(obj, collections.Sequence)"},{"line_number":248,"context_line":"          and not isinstance(obj, six.string_types)):"},{"line_number":249,"context_line":"        for i, v in enumerate(obj):"},{"line_number":250,"context_line":"            if isinstance(v, api.Command):"},{"line_number":251,"context_line":"                obj[i] \u003d v.result"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_0ccb5473","line":248,"range":{"start_line":247,"start_character":9,"end_line":248,"end_character":52},"in_reply_to":"fa7ab95a_05b5fbec","updated":"2016-08-28 22:56:07.000000000","message":"Good question. It would be possible if someone called db_set(\u0027Bridge\u0027, \"br-int\", (\u0027ports\u0027, (port1, ..., portn)), or something that. But I think that would fail anyway because the OVS library uses things like isinstance(item, list) quite a bit. I\u0027ll check.","commit_id":"5877ce0b18e0e49ce7a4476b5e26b9a72561ab20"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"2e77b27eb81ba84b2e5cc32f71b6b0a4081adcbe","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        for k, v in six.iteritems(obj):"},{"line_number":245,"context_line":"            if isinstance(v, api.Command):"},{"line_number":246,"context_line":"                obj[k] \u003d v.result"},{"line_number":247,"context_line":"    elif (isinstance(obj, collections.Sequence)"},{"line_number":248,"context_line":"          and not isinstance(obj, six.string_types)):"},{"line_number":249,"context_line":"        for i, v in enumerate(obj):"},{"line_number":250,"context_line":"            if isinstance(v, api.Command):"},{"line_number":251,"context_line":"                obj[i] \u003d v.result"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_60b5952f","line":248,"range":{"start_line":247,"start_character":9,"end_line":248,"end_character":52},"in_reply_to":"fa7ab95a_0ccb5473","updated":"2016-08-29 16:23:16.000000000","message":"Ok, I\u0027ve checked. Idl.__setattr__() calls Datum.from_python() which specifically checks type(value) in (list, tuple). So this could break where the OVS lib wouldn\u0027t--even if we don\u0027t actually pass code that way. Boo.","commit_id":"5877ce0b18e0e49ce7a4476b5e26b9a72561ab20"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"257883f1550e74bcfe31d9271e7b7a899a8d394f","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        for k, v in six.iteritems(obj):"},{"line_number":245,"context_line":"            if isinstance(v, api.Command):"},{"line_number":246,"context_line":"                obj[k] \u003d v.result"},{"line_number":247,"context_line":"    elif (isinstance(obj, collections.Sequence)"},{"line_number":248,"context_line":"          and not isinstance(obj, six.string_types)):"},{"line_number":249,"context_line":"        for i, v in enumerate(obj):"},{"line_number":250,"context_line":"            if isinstance(v, api.Command):"},{"line_number":251,"context_line":"                obj[i] \u003d v.result"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_8c7bb28b","line":248,"range":{"start_line":247,"start_character":9,"end_line":248,"end_character":52},"in_reply_to":"fa7ab95a_60b5952f","updated":"2016-08-29 17:08:09.000000000","message":"Done. You made me be tricky. :p","commit_id":"5877ce0b18e0e49ce7a4476b5e26b9a72561ab20"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"6196987a3ba29f6e240291bd07aa14097e0feb1f","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                    # NOTE(twilson) If someone passes a tuple, then replace"},{"line_number":255,"context_line":"                    # the tuple we are iterating over with an identical tuple"},{"line_number":256,"context_line":"                    # with the result replaced for this position."},{"line_number":257,"context_line":"                    obj \u003d obj[:i] + type(obj)((v.result,)) + obj[i + 1:]"},{"line_number":258,"context_line":"    elif isinstance(obj, api.Command):"},{"line_number":259,"context_line":"        obj \u003d obj.result"},{"line_number":260,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_df239056","line":257,"updated":"2016-08-29 21:28:34.000000000","message":"I could make this less tricky and way more efficient in the worst-case scenario by breaking out an isinstance(obj, sequence.MutableSequence) and then for non-mutable just doing\n\n obj \u003d type(obj)(v.result if isinstance(obj, api.Comand) else v for v in obj)\n\nthough in the more common case of not having a Command, you end up creating a new sequence object when you don\u0027t have to (which also makes \"is\" comparisons fail, but \"equal\" pass when there is no Command even though the other cases of this function preserve \"is\" comparison). I\u0027m not sure it matters either way.","commit_id":"04200067e879216de52f815006a10fd56299a49b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"862f72a65a016c7f72fe7df57bc44e1023d083b6","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                    # NOTE(twilson) If someone passes a tuple, then replace"},{"line_number":255,"context_line":"                    # the tuple we are iterating over with an identical tuple"},{"line_number":256,"context_line":"                    # with the result replaced for this position."},{"line_number":257,"context_line":"                    obj \u003d obj[:i] + type(obj)((v.result,)) + obj[i + 1:]"},{"line_number":258,"context_line":"    elif isinstance(obj, api.Command):"},{"line_number":259,"context_line":"        obj \u003d obj.result"},{"line_number":260,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_c4f8bc4c","line":257,"in_reply_to":"fa7ab95a_0f057844","updated":"2016-08-31 09:10:26.000000000","message":"I feel dumb. I think I didn\u0027t read through your whole comment.","commit_id":"04200067e879216de52f815006a10fd56299a49b"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"cbaa83a644789bbc62897d4dabfcde90bef9ded6","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                    # NOTE(twilson) If someone passes a tuple, then replace"},{"line_number":255,"context_line":"                    # the tuple we are iterating over with an identical tuple"},{"line_number":256,"context_line":"                    # with the result replaced for this position."},{"line_number":257,"context_line":"                    obj \u003d obj[:i] + type(obj)((v.result,)) + obj[i + 1:]"},{"line_number":258,"context_line":"    elif isinstance(obj, api.Command):"},{"line_number":259,"context_line":"        obj \u003d obj.result"},{"line_number":260,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_a7e8a8e3","line":257,"in_reply_to":"fa7ab95a_66794682","updated":"2016-09-01 18:15:25.000000000","message":"I think that sounds reasonable.","commit_id":"04200067e879216de52f815006a10fd56299a49b"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"5ac52930c50462227ee1252cf706d1925e26287b","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                    # NOTE(twilson) If someone passes a tuple, then replace"},{"line_number":255,"context_line":"                    # the tuple we are iterating over with an identical tuple"},{"line_number":256,"context_line":"                    # with the result replaced for this position."},{"line_number":257,"context_line":"                    obj \u003d obj[:i] + type(obj)((v.result,)) + obj[i + 1:]"},{"line_number":258,"context_line":"    elif isinstance(obj, api.Command):"},{"line_number":259,"context_line":"        obj \u003d obj.result"},{"line_number":260,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_0f057844","line":257,"in_reply_to":"fa7ab95a_87efe11c","updated":"2016-08-30 21:34:17.000000000","message":"Jakub: That looks like what I was suggesting as an alternative in my above comment (just with substituting a type(obj)() and MutableSequence check instead of using tuple specifically (because obviously it is *super* important to handle the case where someone passes a non-tuple non-string immutable sequence /s). It\u0027s certainly doable, I just kind of liked the fact that if there wasn\u0027t a Command object in the object passed, that the original object would be unmodified. But, it does come at a price of being really expensive if a very long tuple containing only command references was passed (something that would never actually happen).","commit_id":"04200067e879216de52f815006a10fd56299a49b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a59406961145e43abf473ced5654ddc8eac205b5","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                    # NOTE(twilson) If someone passes a tuple, then replace"},{"line_number":255,"context_line":"                    # the tuple we are iterating over with an identical tuple"},{"line_number":256,"context_line":"                    # with the result replaced for this position."},{"line_number":257,"context_line":"                    obj \u003d obj[:i] + type(obj)((v.result,)) + obj[i + 1:]"},{"line_number":258,"context_line":"    elif isinstance(obj, api.Command):"},{"line_number":259,"context_line":"        obj \u003d obj.result"},{"line_number":260,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_66794682","line":257,"in_reply_to":"fa7ab95a_c4f8bc4c","updated":"2016-09-01 17:16:15.000000000","message":"So how about not doing the translation per item but once you get TypeError you create a new tuple and call \u0027break\u0027 ?","commit_id":"04200067e879216de52f815006a10fd56299a49b"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"7b3388321c6bebd7f181c8322e5aab20885a5028","unresolved":false,"context_lines":[{"line_number":254,"context_line":"                    # NOTE(twilson) If someone passes a tuple, then replace"},{"line_number":255,"context_line":"                    # the tuple we are iterating over with an identical tuple"},{"line_number":256,"context_line":"                    # with the result replaced for this position."},{"line_number":257,"context_line":"                    obj \u003d obj[:i] + type(obj)((v.result,)) + obj[i + 1:]"},{"line_number":258,"context_line":"    elif isinstance(obj, api.Command):"},{"line_number":259,"context_line":"        obj \u003d obj.result"},{"line_number":260,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_87efe11c","line":257,"in_reply_to":"fa7ab95a_df239056","updated":"2016-08-30 09:33:34.000000000","message":"How about re-building the tuple right away?\n\n elif isinstance(obj, tuple):\n     obj \u003d tuple(item.result if isinstance(item, api.Command) else item\n                 for item in obj)\n elif isinstance(obj, list):","commit_id":"04200067e879216de52f815006a10fd56299a49b"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"084314b7b75698bfba8ad4813a7668afc6ccb3c4","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def row_by_record(idl_, table, record):"},{"line_number":66,"context_line":"    if isinstance(record, idl.Row):"},{"line_number":67,"context_line":"        return record"},{"line_number":68,"context_line":"    t \u003d idl_.tables[table]"},{"line_number":69,"context_line":"    try:"},{"line_number":70,"context_line":"        if isinstance(record, uuid.UUID):"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a98d1f4_e3523612","line":67,"updated":"2016-10-04 05:52:46.000000000","message":"is this for the case the temporary cmd.result is being used?\nhow can it happen?","commit_id":"0de56ecd64666fa1c86c58f31fc2d5729fe90b1d"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"8205a46fb3980bea7c0bdb405fd594e5362ae79b","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"def row_by_record(idl_, table, record):"},{"line_number":66,"context_line":"    if isinstance(record, idl.Row):"},{"line_number":67,"context_line":"        return record"},{"line_number":68,"context_line":"    t \u003d idl_.tables[table]"},{"line_number":69,"context_line":"    try:"},{"line_number":70,"context_line":"        if isinstance(record, uuid.UUID):"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a95cdbc_ca645b4b","line":67,"in_reply_to":"3a98d1f4_e3523612","updated":"2016-10-04 15:21:02.000000000","message":"I believe it is left over code that was required by a previous solution attempt. It shouldn\u0027t be required by the current code. I\u0027ll go ahead and remove it.","commit_id":"0de56ecd64666fa1c86c58f31fc2d5729fe90b1d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"88a2a3a3ab15b927783d38db71f71d2599741f35","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                except TypeError:"},{"line_number":259,"context_line":"                    # NOTE(twilson) If someone passes a tuple, then just return"},{"line_number":260,"context_line":"                    # a tuple with the Commands replaced with their results"},{"line_number":261,"context_line":"                    return type(obj)(getattr(v, \"result\", v) for v in obj)"},{"line_number":262,"context_line":"    elif isinstance(obj, api.Command):"},{"line_number":263,"context_line":"        obj \u003d obj.result"},{"line_number":264,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_2c7835c4","line":261,"range":{"start_line":261,"start_character":27,"end_line":261,"end_character":36},"updated":"2016-09-06 08:12:52.000000000","message":"Super duper nit: If we\u0027re sure that tuple was passed, would it make sense to call tuple() here instead of type? I\u0027d say it improves readability.","commit_id":"0de56ecd64666fa1c86c58f31fc2d5729fe90b1d"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"0f49a0c190a0bc6fefdb35183a15fbb376695671","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                except TypeError:"},{"line_number":259,"context_line":"                    # NOTE(twilson) If someone passes a tuple, then just return"},{"line_number":260,"context_line":"                    # a tuple with the Commands replaced with their results"},{"line_number":261,"context_line":"                    return type(obj)(getattr(v, \"result\", v) for v in obj)"},{"line_number":262,"context_line":"    elif isinstance(obj, api.Command):"},{"line_number":263,"context_line":"        obj \u003d obj.result"},{"line_number":264,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":8,"id":"3a98d1f4_81d04a55","line":261,"range":{"start_line":261,"start_character":27,"end_line":261,"end_character":36},"in_reply_to":"9a89bdaa_18729449","updated":"2016-09-29 08:32:26.000000000","message":"Fair enough :)","commit_id":"0de56ecd64666fa1c86c58f31fc2d5729fe90b1d"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"1aa8f0aebd85f3eb3fb2134602bca54053cb52ea","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                except TypeError:"},{"line_number":259,"context_line":"                    # NOTE(twilson) If someone passes a tuple, then just return"},{"line_number":260,"context_line":"                    # a tuple with the Commands replaced with their results"},{"line_number":261,"context_line":"                    return type(obj)(getattr(v, \"result\", v) for v in obj)"},{"line_number":262,"context_line":"    elif isinstance(obj, api.Command):"},{"line_number":263,"context_line":"        obj \u003d obj.result"},{"line_number":264,"context_line":"    return obj"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a89bdaa_18729449","line":261,"range":{"start_line":261,"start_character":27,"end_line":261,"end_character":36},"in_reply_to":"9a89bdaa_2c7835c4","updated":"2016-09-07 02:32:19.000000000","message":"Just being super-duper pedantic since we don\u0027t *technically* know that a tuple is being passed in (even though it is the only built-in type that is both an immutable sequence and not a string type). I figured it didn\u0027t really cost much to be completely duck-type-y. :p","commit_id":"0de56ecd64666fa1c86c58f31fc2d5729fe90b1d"}],"neutron/tests/functional/agent/test_ovs_lib.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"70c3ce3b68ede762f7929e48e284deba9d83a952","unresolved":false,"context_lines":[{"line_number":398,"context_line":"        self.assertEqual(tags_42, single_value.result)"},{"line_number":399,"context_line":"        self.assertItemsEqual(len_0_list.result, tags_present)"},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"    def test_db_create_result(self):"},{"line_number":402,"context_line":"        with self.ovs.ovsdb.transaction(check_error\u003dTrue) as txn:"},{"line_number":403,"context_line":"            res \u003d txn.add(self.ovs.ovsdb.db_create(\"QoS\","},{"line_number":404,"context_line":"                                                   other_config\u003d{\u0027a\u0027: \u00271\u0027}))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_3ad96e84","line":401,"updated":"2016-08-22 09:12:06.000000000","message":"Would it make sense to add another test that validates uuid is None in case the row doesn\u0027t persist after transaction is finished?\n\ne.g.\n\n with ovsdb.transaction() as txn:\n    res_add \u003d txn.add(db_create())\n    txn.add(db_destroy())\n\n self.assertNone(res_add.result)","commit_id":"6be4e86dc598e0a73ff6bba8a7e06f71d677846f"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"3bc09d656b5474897cc7597e1d30b2b6b95afee4","unresolved":false,"context_lines":[{"line_number":398,"context_line":"        self.assertEqual(tags_42, single_value.result)"},{"line_number":399,"context_line":"        self.assertItemsEqual(len_0_list.result, tags_present)"},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"    def test_db_create_result(self):"},{"line_number":402,"context_line":"        with self.ovs.ovsdb.transaction(check_error\u003dTrue) as txn:"},{"line_number":403,"context_line":"            res \u003d txn.add(self.ovs.ovsdb.db_create(\"QoS\","},{"line_number":404,"context_line":"                                                   other_config\u003d{\u0027a\u0027: \u00271\u0027}))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_6c2fa6f6","line":401,"in_reply_to":"1ac06dbe_3ad96e84","updated":"2016-08-22 13:22:18.000000000","message":"I think this is kind of hard to do because you don\u0027t actually have the uuid inside the transaction to pass to db_destroy and neither the native nor vsctl interface have implemented the equivalent of \"named-uuid\" passing in the OVSDB spec where you can reference entities created by different ops within the same transaction.\n\nI think it would probably be possible to do at some point, but it looks a bit tricky.","commit_id":"6be4e86dc598e0a73ff6bba8a7e06f71d677846f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"dc5033e13a477e7a88f8d71179ae0db3fff9eb04","unresolved":false,"context_lines":[{"line_number":398,"context_line":"        self.assertEqual(tags_42, single_value.result)"},{"line_number":399,"context_line":"        self.assertItemsEqual(len_0_list.result, tags_present)"},{"line_number":400,"context_line":""},{"line_number":401,"context_line":"    def test_db_create_result(self):"},{"line_number":402,"context_line":"        with self.ovs.ovsdb.transaction(check_error\u003dTrue) as txn:"},{"line_number":403,"context_line":"            res \u003d txn.add(self.ovs.ovsdb.db_create(\"QoS\","},{"line_number":404,"context_line":"                                                   other_config\u003d{\u0027a\u0027: \u00271\u0027}))"}],"source_content_type":"text/x-python","patch_set":2,"id":"1ac06dbe_c2aca3a2","line":401,"in_reply_to":"1ac06dbe_6c2fa6f6","updated":"2016-08-22 13:52:49.000000000","message":"I didn\u0027t mean to pass uuid but the row that was created (if there is a way :) ). Something to cover case where get_insert_uuid() returns None","commit_id":"6be4e86dc598e0a73ff6bba8a7e06f71d677846f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"2996626ea6f3a9f739e3ceb3d0d2ecf555d31f2d","unresolved":false,"context_lines":[{"line_number":346,"context_line":"            with self.ovs.ovsdb.transaction() as t:"},{"line_number":347,"context_line":"                t.add(self.ovs.ovsdb.db_destroy(\"QoS\", qos.result))"},{"line_number":348,"context_line":"                t.add(self.ovs.ovsdb.db_destroy(\"Queue\", queue.result))"},{"line_number":349,"context_line":"                t.add(self.ovs.ovsdb.db_clear(\"Port\", self.br.br_name, \u0027qos\u0027))"},{"line_number":350,"context_line":""},{"line_number":351,"context_line":"        self.addCleanup(cleanup)"},{"line_number":352,"context_line":"        val \u003d self.ovs.ovsdb.db_get(\"Port\", self.br.br_name, \u0027qos\u0027).execute()"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_4596234d","line":349,"updated":"2016-08-27 09:21:21.000000000","message":"Is this line needed? self.br is a Fixture and thus the whole bridge will be removed from ovsdb.","commit_id":"5877ce0b18e0e49ce7a4476b5e26b9a72561ab20"},{"author":{"_account_id":5756,"name":"Terry Wilson","email":"twilson@redhat.com","username":"otherwiseguy"},"change_message_id":"9af804d4d3ae8245f92bf2e8d790309216078f07","unresolved":false,"context_lines":[{"line_number":346,"context_line":"            with self.ovs.ovsdb.transaction() as t:"},{"line_number":347,"context_line":"                t.add(self.ovs.ovsdb.db_destroy(\"QoS\", qos.result))"},{"line_number":348,"context_line":"                t.add(self.ovs.ovsdb.db_destroy(\"Queue\", queue.result))"},{"line_number":349,"context_line":"                t.add(self.ovs.ovsdb.db_clear(\"Port\", self.br.br_name, \u0027qos\u0027))"},{"line_number":350,"context_line":""},{"line_number":351,"context_line":"        self.addCleanup(cleanup)"},{"line_number":352,"context_line":"        val \u003d self.ovs.ovsdb.db_get(\"Port\", self.br.br_name, \u0027qos\u0027).execute()"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa7ab95a_ece8f0e4","line":349,"in_reply_to":"fa7ab95a_4596234d","updated":"2016-08-28 22:56:07.000000000","message":"It does it in the wrong order. We have to remove the reference to the qos record before (or while) removing the qos record. I initially tried to let it take care of it, but no go.","commit_id":"5877ce0b18e0e49ce7a4476b5e26b9a72561ab20"}]}
