)]}'
{"nova/db/sqlalchemy/api.py":[{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"f8fe132cd9b95078ea3a340ccb48945fe0303dd3","unresolved":false,"context_lines":[{"line_number":867,"context_line":""},{"line_number":868,"context_line":"    try:"},{"line_number":869,"context_line":"        compute_node_ref.update(values)"},{"line_number":870,"context_line":"        compute_node_ref.save(context.session)"},{"line_number":871,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":872,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"},{"line_number":873,"context_line":"        # create the compute node entry at the same time. First one"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_cd93a44e","line":870,"updated":"2016-04-12 07:36:10.000000000","message":"Does it make sense to have a unit test where a mocked \"save\" method raises a DBDuplicateEntry error? Otherwise, the code looks good to me.","commit_id":"01c439400c11619dc46308e1b73ce7b8a95d3964"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"037dd5560b8a4f697d1943db7d44dcd25592be93","unresolved":false,"context_lines":[{"line_number":867,"context_line":""},{"line_number":868,"context_line":"    try:"},{"line_number":869,"context_line":"        compute_node_ref.update(values)"},{"line_number":870,"context_line":"        compute_node_ref.save(context.session)"},{"line_number":871,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":872,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"},{"line_number":873,"context_line":"        # create the compute node entry at the same time. First one"}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_bb6da634","line":870,"in_reply_to":"5a18252c_cd93a44e","updated":"2016-04-12 16:07:32.000000000","message":"+ for adding a unit test","commit_id":"01c439400c11619dc46308e1b73ce7b8a95d3964"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"037dd5560b8a4f697d1943db7d44dcd25592be93","unresolved":false,"context_lines":[{"line_number":868,"context_line":"    try:"},{"line_number":869,"context_line":"        compute_node_ref.update(values)"},{"line_number":870,"context_line":"        compute_node_ref.save(context.session)"},{"line_number":871,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":872,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"},{"line_number":873,"context_line":"        # create the compute node entry at the same time. First one"},{"line_number":874,"context_line":"        # wins."}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_1b365a03","line":871,"updated":"2016-04-12 16:07:32.000000000","message":"So... giving the fact we are using EngineFacade now, compute_node_create() can potentially be executed in the context of an ongoing DB transactions. By the time you catch an exception here, the transaction has already failed with an integrity error - you can\u0027t do any other queries before restarting it.\n\nI suggest we do something like https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L4385-L4401 and use a SAVEPOINT.","commit_id":"01c439400c11619dc46308e1b73ce7b8a95d3964"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"024bff25df960d17af6fb1de6369f1d887a30dd8","unresolved":false,"context_lines":[{"line_number":868,"context_line":"    try:"},{"line_number":869,"context_line":"        compute_node_ref.update(values)"},{"line_number":870,"context_line":"        compute_node_ref.save(context.session)"},{"line_number":871,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":872,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"},{"line_number":873,"context_line":"        # create the compute node entry at the same time. First one"},{"line_number":874,"context_line":"        # wins."}],"source_content_type":"text/x-python","patch_set":1,"id":"7aa08908_0ab1b747","line":871,"in_reply_to":"5a18252c_1b365a03","updated":"2016-06-07 07:24:31.000000000","message":"Thanks for your feedback.\n\nCan you please give the exact line numbers of changes, as the code in api.py has changed, and the line number are modified.","commit_id":"01c439400c11619dc46308e1b73ce7b8a95d3964"},{"author":{"_account_id":18603,"name":"Béla Vancsics","email":"vancsics@inf.u-szeged.hu","username":"vancsics"},"change_message_id":"e463625e29e127d5048be16da672558de699952b","unresolved":false,"context_lines":[{"line_number":871,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":872,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"},{"line_number":873,"context_line":"        # create the compute node entry at the same time. First one"},{"line_number":874,"context_line":"        # wins."},{"line_number":875,"context_line":"        pass"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"    return compute_node_ref"},{"line_number":878,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_e38cb037","line":875,"range":{"start_line":874,"start_character":15,"end_line":875,"end_character":8},"updated":"2016-04-12 08:44:49.000000000","message":"The code looks good to me too\nI think it would be good in a LOG.warning()\n(This is just an idea)","commit_id":"01c439400c11619dc46308e1b73ce7b8a95d3964"},{"author":{"_account_id":18603,"name":"Béla Vancsics","email":"vancsics@inf.u-szeged.hu","username":"vancsics"},"change_message_id":"1eb0c6ebb2636c96754e608222ab7a82ce5f45ff","unresolved":false,"context_lines":[{"line_number":871,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":872,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"},{"line_number":873,"context_line":"        # create the compute node entry at the same time. First one"},{"line_number":874,"context_line":"        # wins."},{"line_number":875,"context_line":"        pass"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"    return compute_node_ref"},{"line_number":878,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_a69c866a","line":875,"range":{"start_line":874,"start_character":15,"end_line":875,"end_character":8},"in_reply_to":"5a18252c_46cad2a2","updated":"2016-04-12 09:03:30.000000000","message":"All right - you have convinced me :)","commit_id":"01c439400c11619dc46308e1b73ce7b8a95d3964"},{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"7c6957c60ab678a63009a58d01815067dae9a95b","unresolved":false,"context_lines":[{"line_number":871,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":872,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"},{"line_number":873,"context_line":"        # create the compute node entry at the same time. First one"},{"line_number":874,"context_line":"        # wins."},{"line_number":875,"context_line":"        pass"},{"line_number":876,"context_line":""},{"line_number":877,"context_line":"    return compute_node_ref"},{"line_number":878,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"5a18252c_46cad2a2","line":875,"range":{"start_line":874,"start_character":15,"end_line":875,"end_character":8},"in_reply_to":"5a18252c_e38cb037","updated":"2016-04-12 08:59:15.000000000","message":"@Bela: I\u0027d rather not add a warning log here. There is no way the ops can do something to prevent that warning in the future. This would be against the logging guidelines [1] IMO.\n\n[1] https://specs.openstack.org/openstack/openstack-specs/specs/log-guidelines.html#definition-of-log-levels","commit_id":"01c439400c11619dc46308e1b73ce7b8a95d3964"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"3564f0f2d774375b4e0b3bf592806a591a792e3e","unresolved":false,"context_lines":[{"line_number":868,"context_line":"    try:"},{"line_number":869,"context_line":"        compute_node_ref.update(values)"},{"line_number":870,"context_line":"        compute_node_ref.save(context.session)"},{"line_number":871,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":872,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"},{"line_number":873,"context_line":"        # create the compute node entry at the same time. First one"},{"line_number":874,"context_line":"        # wins."}],"source_content_type":"text/x-python","patch_set":2,"id":"7aa08908_5adc5b12","line":871,"updated":"2016-06-06 14:06:29.000000000","message":"Looks like you\u0027ve missed my comment to the previous patch set, repeating it here....\n\nGiving the fact we are using EngineFacade now, compute_node_create() can potentially be executed in the context of an ongoing DB transactions. By the time you catch an exception here, the transaction has already failed with an integrity error - you can\u0027t do any other queries before restarting it.\nI suggest we do something like https://github.com/openstack/nova/blob/master/nova/db/sqlalchemy/api.py#L4385-L4401 and use a SAVEPOINT.","commit_id":"4d57197b1a9a99ada8274c1387df8d99802a8fed"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"b137322b08c8e9e8a6952377abc08ccad8100f9f","unresolved":false,"context_lines":[{"line_number":672,"context_line":"            all()"},{"line_number":673,"context_line":""},{"line_number":674,"context_line":""},{"line_number":675,"context_line":"@pick_context_manager_writer"},{"line_number":676,"context_line":"def compute_node_create(context, values):"},{"line_number":677,"context_line":"    \"\"\"Creates a new ComputeNode and populates the capacity fields"},{"line_number":678,"context_line":"    with the most recent data."}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_c3c9f0ad","line":675,"updated":"2016-08-01 11:24:39.000000000","message":"Decorator and context manager forms of using EngineFacade are sort of mutually exclusive in a sense, that you really need only one of them here.\n\nI suggest we remove the decorator and keep the context manager below, as the nova decorator does not currently allow to easily use more advanced features like savepoints.","commit_id":"a920eff7d6a467761782865e64c21852c0be8f62"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"b137322b08c8e9e8a6952377abc08ccad8100f9f","unresolved":false,"context_lines":[{"line_number":682,"context_line":"    compute_node_ref \u003d models.ComputeNode()"},{"line_number":683,"context_line":"    compute_node_ref.update(values)"},{"line_number":684,"context_line":"    try:"},{"line_number":685,"context_line":"        with main_context_manager.writer.savepoint.using(context):"},{"line_number":686,"context_line":"            compute_node_ref.save(context.session)"},{"line_number":687,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":688,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"}],"source_content_type":"text/x-python","patch_set":6,"id":"bacf61ea_e3f7d4d0","line":685,"updated":"2016-08-01 11:24:39.000000000","message":"Instead of referring to main_context_manager directly you should probably call get_context_manager(), so that it picks the \"correct\" DB for you (should we move these tables to a another DB in the future)","commit_id":"a920eff7d6a467761782865e64c21852c0be8f62"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"64b86644ff4a102a8e419344792454e94f3c9652","unresolved":false,"context_lines":[{"line_number":704,"context_line":"    compute_node_ref \u003d models.ComputeNode()"},{"line_number":705,"context_line":"    compute_node_ref.update(values)"},{"line_number":706,"context_line":"    try:"},{"line_number":707,"context_line":"\twith get_context_manager(context).writer.savepoint.using(context):"},{"line_number":708,"context_line":"            compute_node_ref.save(context.session)"},{"line_number":709,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":710,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad45d7e_2fd996f3","line":707,"updated":"2016-08-12 07:07:11.000000000","message":"nit: tab","commit_id":"56c8ba2bd9697ed697655e1fe198cec6eefe5a6c"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"94d61ab4d026ea1e7c1873fe89ca6c51de0662c2","unresolved":false,"context_lines":[{"line_number":704,"context_line":"    compute_node_ref \u003d models.ComputeNode()"},{"line_number":705,"context_line":"    compute_node_ref.update(values)"},{"line_number":706,"context_line":"    try:"},{"line_number":707,"context_line":"\twith get_context_manager(context).writer.savepoint.using(context):"},{"line_number":708,"context_line":"            compute_node_ref.save(context.session)"},{"line_number":709,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":710,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad45d7e_9bd6fb25","line":707,"in_reply_to":"9ad45d7e_2fd996f3","updated":"2016-08-12 09:43:04.000000000","message":"Done","commit_id":"56c8ba2bd9697ed697655e1fe198cec6eefe5a6c"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"7d31e4956ef1dbbefb8999bd4eac757fab8ccd5f","unresolved":false,"context_lines":[{"line_number":704,"context_line":"    compute_node_ref \u003d models.ComputeNode()"},{"line_number":705,"context_line":"    compute_node_ref.update(values)"},{"line_number":706,"context_line":"    try:"},{"line_number":707,"context_line":"\twith get_context_manager(context).writer.savepoint.using(context):"},{"line_number":708,"context_line":"            compute_node_ref.save(context.session)"},{"line_number":709,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":710,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad45d7e_3b0f1438","line":707,"in_reply_to":"9ad45d7e_2fd996f3","updated":"2016-08-12 08:31:49.000000000","message":"Unfortunately, it\u0027s not nit, it\u0027s currently broken :(","commit_id":"56c8ba2bd9697ed697655e1fe198cec6eefe5a6c"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"94d61ab4d026ea1e7c1873fe89ca6c51de0662c2","unresolved":false,"context_lines":[{"line_number":704,"context_line":"    compute_node_ref \u003d models.ComputeNode()"},{"line_number":705,"context_line":"    compute_node_ref.update(values)"},{"line_number":706,"context_line":"    try:"},{"line_number":707,"context_line":"\twith get_context_manager(context).writer.savepoint.using(context):"},{"line_number":708,"context_line":"            compute_node_ref.save(context.session)"},{"line_number":709,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":710,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad45d7e_dbe073fd","line":707,"in_reply_to":"9ad45d7e_3b0f1438","updated":"2016-08-12 09:43:04.000000000","message":"Done","commit_id":"56c8ba2bd9697ed697655e1fe198cec6eefe5a6c"},{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"64b86644ff4a102a8e419344792454e94f3c9652","unresolved":false,"context_lines":[{"line_number":709,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":710,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"},{"line_number":711,"context_line":"        # create the compute node entry at the same time. First one"},{"line_number":712,"context_line":"        # wins."},{"line_number":713,"context_line":"        pass"},{"line_number":714,"context_line":""},{"line_number":715,"context_line":"    return compute_node_ref"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad45d7e_cff0ba69","line":712,"updated":"2016-08-12 07:07:11.000000000","message":"Possibly, not warning but debug will be good here.","commit_id":"56c8ba2bd9697ed697655e1fe198cec6eefe5a6c"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"7d31e4956ef1dbbefb8999bd4eac757fab8ccd5f","unresolved":false,"context_lines":[{"line_number":709,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":710,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"},{"line_number":711,"context_line":"        # create the compute node entry at the same time. First one"},{"line_number":712,"context_line":"        # wins."},{"line_number":713,"context_line":"        pass"},{"line_number":714,"context_line":""},{"line_number":715,"context_line":"    return compute_node_ref"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad45d7e_5b29289a","line":712,"in_reply_to":"9ad45d7e_cff0ba69","updated":"2016-08-12 08:31:49.000000000","message":"Definitely not warning, debug is fine.","commit_id":"56c8ba2bd9697ed697655e1fe198cec6eefe5a6c"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"443ee15217623fc18ad11d6cc157b61983677fc9","unresolved":false,"context_lines":[{"line_number":709,"context_line":"    except db_exc.DBDuplicateEntry:"},{"line_number":710,"context_line":"        # NOTE(ratailor): Possible race if two greenthreads attempt to"},{"line_number":711,"context_line":"        # create the compute node entry at the same time. First one"},{"line_number":712,"context_line":"        # wins."},{"line_number":713,"context_line":"        pass"},{"line_number":714,"context_line":""},{"line_number":715,"context_line":"    return compute_node_ref"}],"source_content_type":"text/x-python","patch_set":8,"id":"9ad45d7e_9c15519d","line":712,"updated":"2016-08-12 10:32:50.000000000","message":"I do not think a debug log entry is necessary, but Andrey V. may disagree :)","commit_id":"203eff1f5fbcbcbd1325fc44415e3d6e03d34b41"}],"nova/tests/unit/db/test_db_api.py":[{"author":{"_account_id":21813,"name":"Andrey Volkov","email":"m@amadev.ru","username":"avolkov"},"change_message_id":"64b86644ff4a102a8e419344792454e94f3c9652","unresolved":false,"context_lines":[{"line_number":7649,"context_line":"        new_stats \u003d jsonutils.loads(self.item[\u0027stats\u0027])"},{"line_number":7650,"context_line":"        self.assertEqual(self.stats, new_stats)"},{"line_number":7651,"context_line":""},{"line_number":7652,"context_line":"    def test_compute_node_create_to_duplicate(self):"},{"line_number":7653,"context_line":"        compute_node_data \u003d dict(vcpus\u003d1, memory_mb\u003d512, local_gb\u003d10,"},{"line_number":7654,"context_line":"                                    vcpus_used\u003d0, memory_mb_used\u003d256,"},{"line_number":7655,"context_line":"                                    local_gb_used\u003d5, uuid\u003d\u0027foo\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad45d7e_eacbeca1","line":7652,"updated":"2016-08-12 07:07:11.000000000","message":"Actually you are testing that compute_node_create doesn\u0027t fail with exception in this case, right?\nBecause creating duplicated nodes is impossible by db definition.\nIMO def create_does_not_fail_on_duplication is appropriate.","commit_id":"56c8ba2bd9697ed697655e1fe198cec6eefe5a6c"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"94d61ab4d026ea1e7c1873fe89ca6c51de0662c2","unresolved":false,"context_lines":[{"line_number":7649,"context_line":"        new_stats \u003d jsonutils.loads(self.item[\u0027stats\u0027])"},{"line_number":7650,"context_line":"        self.assertEqual(self.stats, new_stats)"},{"line_number":7651,"context_line":""},{"line_number":7652,"context_line":"    def test_compute_node_create_to_duplicate(self):"},{"line_number":7653,"context_line":"        compute_node_data \u003d dict(vcpus\u003d1, memory_mb\u003d512, local_gb\u003d10,"},{"line_number":7654,"context_line":"                                    vcpus_used\u003d0, memory_mb_used\u003d256,"},{"line_number":7655,"context_line":"                                    local_gb_used\u003d5, uuid\u003d\u0027foo\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad45d7e_7bf067ca","line":7652,"in_reply_to":"9ad45d7e_07abd6d7","updated":"2016-08-12 09:43:04.000000000","message":"Done","commit_id":"56c8ba2bd9697ed697655e1fe198cec6eefe5a6c"},{"author":{"_account_id":20733,"name":"Rajesh Tailor","email":"ratailor@redhat.com","username":"rajesht"},"change_message_id":"94d61ab4d026ea1e7c1873fe89ca6c51de0662c2","unresolved":false,"context_lines":[{"line_number":7649,"context_line":"        new_stats \u003d jsonutils.loads(self.item[\u0027stats\u0027])"},{"line_number":7650,"context_line":"        self.assertEqual(self.stats, new_stats)"},{"line_number":7651,"context_line":""},{"line_number":7652,"context_line":"    def test_compute_node_create_to_duplicate(self):"},{"line_number":7653,"context_line":"        compute_node_data \u003d dict(vcpus\u003d1, memory_mb\u003d512, local_gb\u003d10,"},{"line_number":7654,"context_line":"                                    vcpus_used\u003d0, memory_mb_used\u003d256,"},{"line_number":7655,"context_line":"                                    local_gb_used\u003d5, uuid\u003d\u0027foo\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad45d7e_1be32b07","line":7652,"in_reply_to":"9ad45d7e_eacbeca1","updated":"2016-08-12 09:43:04.000000000","message":"Done","commit_id":"56c8ba2bd9697ed697655e1fe198cec6eefe5a6c"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"7d31e4956ef1dbbefb8999bd4eac757fab8ccd5f","unresolved":false,"context_lines":[{"line_number":7649,"context_line":"        new_stats \u003d jsonutils.loads(self.item[\u0027stats\u0027])"},{"line_number":7650,"context_line":"        self.assertEqual(self.stats, new_stats)"},{"line_number":7651,"context_line":""},{"line_number":7652,"context_line":"    def test_compute_node_create_to_duplicate(self):"},{"line_number":7653,"context_line":"        compute_node_data \u003d dict(vcpus\u003d1, memory_mb\u003d512, local_gb\u003d10,"},{"line_number":7654,"context_line":"                                    vcpus_used\u003d0, memory_mb_used\u003d256,"},{"line_number":7655,"context_line":"                                    local_gb_used\u003d5, uuid\u003d\u0027foo\u0027,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9ad45d7e_07abd6d7","line":7652,"in_reply_to":"9ad45d7e_eacbeca1","updated":"2016-08-12 08:31:49.000000000","message":"or test_compute_node_create_handles_duplicate_error()","commit_id":"56c8ba2bd9697ed697655e1fe198cec6eefe5a6c"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"bd6bf90d89fea0b45490da2aeadf72c82a2ee17a","unresolved":false,"context_lines":[{"line_number":7651,"context_line":""},{"line_number":7652,"context_line":"    def test_compute_node_create_handles_duplicate_error(self):"},{"line_number":7653,"context_line":"        compute_node_data \u003d dict(vcpus\u003d1, memory_mb\u003d512, local_gb\u003d10,"},{"line_number":7654,"context_line":"                                    vcpus_used\u003d0, memory_mb_used\u003d256,"},{"line_number":7655,"context_line":"                                    local_gb_used\u003d5, uuid\u003d\u0027foo\u0027,"},{"line_number":7656,"context_line":"                                    hypervisor_type\u003d\u0027HyperDanVM\u0027,"},{"line_number":7657,"context_line":"                                    hypervisor_version\u003d34, cpu_info\u003d\u0027foo\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_4f0d8c3d","line":7654,"range":{"start_line":7654,"start_character":33,"end_line":7654,"end_character":36},"updated":"2016-08-16 12:36:55.000000000","message":"I think it could be shifted","commit_id":"203eff1f5fbcbcbd1325fc44415e3d6e03d34b41"},{"author":{"_account_id":6849,"name":"Roman Podoliaka","email":"roman.podoliaka@gmail.com","username":"rpodolyaka"},"change_message_id":"443ee15217623fc18ad11d6cc157b61983677fc9","unresolved":false,"context_lines":[{"line_number":7662,"context_line":"            db.compute_node_create(self.ctxt, compute_node_data)"},{"line_number":7663,"context_line":"            nodes \u003d db.compute_node_get_all(self.ctxt)"},{"line_number":7664,"context_line":""},{"line_number":7665,"context_line":"            # Check only one compute node added with given values"},{"line_number":7666,"context_line":"            res_node \u003d [node for node in nodes if node[\u0027uuid\u0027] \u003d\u003d \u0027foo\u0027][0]"},{"line_number":7667,"context_line":"            for k, v in six.iteritems(compute_node_data):"},{"line_number":7668,"context_line":"                self.assertEqual(v, res_node[k])"}],"source_content_type":"text/x-python","patch_set":8,"id":"9ad45d7e_fc33ad60","line":7665,"range":{"start_line":7665,"start_character":44,"end_line":7665,"end_character":45},"updated":"2016-08-12 10:32:50.000000000","message":"nit: we could actually assert on len(nodes) \u003d\u003d 1","commit_id":"203eff1f5fbcbcbd1325fc44415e3d6e03d34b41"},{"author":{"_account_id":10618,"name":"Pavel Kholkin","email":"p.v.holkin@mail.ru","username":"pkholkin"},"change_message_id":"bd6bf90d89fea0b45490da2aeadf72c82a2ee17a","unresolved":false,"context_lines":[{"line_number":7662,"context_line":"            db.compute_node_create(self.ctxt, compute_node_data)"},{"line_number":7663,"context_line":"            nodes \u003d db.compute_node_get_all(self.ctxt)"},{"line_number":7664,"context_line":""},{"line_number":7665,"context_line":"            # Check only one compute node added with given values"},{"line_number":7666,"context_line":"            res_node \u003d [node for node in nodes if node[\u0027uuid\u0027] \u003d\u003d \u0027foo\u0027][0]"},{"line_number":7667,"context_line":"            for k, v in six.iteritems(compute_node_data):"},{"line_number":7668,"context_line":"                self.assertEqual(v, res_node[k])"}],"source_content_type":"text/x-python","patch_set":8,"id":"3ac371cc_aad6ae24","line":7665,"range":{"start_line":7665,"start_character":44,"end_line":7665,"end_character":45},"in_reply_to":"9ad45d7e_fc33ad60","updated":"2016-08-16 12:36:55.000000000","message":"agree, I don\u0027t like the code below.\n\nWe can use e.g. self._assertEqualObjects() or self._assertEqualListsOfObjects() functions like it is done in some other tests here.","commit_id":"203eff1f5fbcbcbd1325fc44415e3d6e03d34b41"}]}
