)]}'
{"nova/objects/compute_node.py":[{"author":{"_account_id":12299,"name":"Paweł Koniszewski","email":"pawel.koniszewski@gmail.com","username":"pawel.koniszewski"},"change_message_id":"fb6b6e7ea6e2ce7c52595fa6de6b2ade2480f4e1","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"import nova.conf"},{"line_number":22,"context_line":"from nova import db"},{"line_number":23,"context_line":"from nova.db.sqlalchemy import api as sqla_api"},{"line_number":24,"context_line":"from nova.db.sqlalchemy import models"},{"line_number":25,"context_line":"from nova import exception"},{"line_number":26,"context_line":"from nova import objects"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_56ca561b","line":23,"range":{"start_line":23,"start_character":38,"end_line":23,"end_character":46},"updated":"2017-01-11 10:21:47.000000000","message":"nit: i\u0027d change this to db_api to match most of such imports, sqla_api would be another name for database api import.","commit_id":"02d3e1613df040302ce4f5917fae604a2cca653f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2a1ed0d783c2ba75893bbaaa386e8d2b993c7f7b","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"import nova.conf"},{"line_number":22,"context_line":"from nova import db"},{"line_number":23,"context_line":"from nova.db.sqlalchemy import api as sqla_api"},{"line_number":24,"context_line":"from nova.db.sqlalchemy import models"},{"line_number":25,"context_line":"from nova import exception"},{"line_number":26,"context_line":"from nova import objects"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_10c0ce29","line":23,"in_reply_to":"ba5201f7_56ca561b","updated":"2017-01-11 11:53:43.000000000","message":"See my comment below for why I think we can (and probably should) forego these two lines.","commit_id":"02d3e1613df040302ce4f5917fae604a2cca653f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2a1ed0d783c2ba75893bbaaa386e8d2b993c7f7b","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        return cls._from_db_object(context, cls(), db_compute)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @staticmethod"},{"line_number":239,"context_line":"    @sqla_api.main_context_manager.reader"},{"line_number":240,"context_line":"    def _get_by_compute_node_uuid_from_db(context, compute_uuid):"},{"line_number":241,"context_line":"        db_compute \u003d context.session.query(models.ComputeNode).filter_by("},{"line_number":242,"context_line":"            uuid\u003dcompute_uuid).first()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_109b6e73","line":239,"updated":"2017-01-11 11:53:43.000000000","message":"Since the other database-accessing methods on this class are using db.api, would it make sense for this too? Then you could create a db.compute_node_get_by_uuid() and within that reuse _compute_node_fetchall\n\nI know that there\u0027s a trend now to do db handling within new objects, at least those that use the API database, but I would think that consistency and reuse of existing code would be good for a class that\u0027s been around for some time?","commit_id":"02d3e1613df040302ce4f5917fae604a2cca653f"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"12f8b123e95050373cc9b760d65a224469dd3835","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        return cls._from_db_object(context, cls(), db_compute)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @staticmethod"},{"line_number":239,"context_line":"    @sqla_api.main_context_manager.reader"},{"line_number":240,"context_line":"    def _get_by_compute_node_uuid_from_db(context, compute_uuid):"},{"line_number":241,"context_line":"        db_compute \u003d context.session.query(models.ComputeNode).filter_by("},{"line_number":242,"context_line":"            uuid\u003dcompute_uuid).first()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_35de9211","line":239,"in_reply_to":"ba5201f7_07d08f52","updated":"2017-01-11 16:23:10.000000000","message":"I agree with Sylvain - the use of db.api is an example of YAGNI, for those cases where we wanted a different IMPL than sqlalchemy. I don\u0027t see that happening, do you?\n\nThe only good argument for using db.api is consistency with the rest of the code, but I don\u0027t think that\u0027s sufficient.","commit_id":"02d3e1613df040302ce4f5917fae604a2cca653f"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"65814e099f131d24b2561d3345b704b29f225b6a","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        return cls._from_db_object(context, cls(), db_compute)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @staticmethod"},{"line_number":239,"context_line":"    @sqla_api.main_context_manager.reader"},{"line_number":240,"context_line":"    def _get_by_compute_node_uuid_from_db(context, compute_uuid):"},{"line_number":241,"context_line":"        db_compute \u003d context.session.query(models.ComputeNode).filter_by("},{"line_number":242,"context_line":"            uuid\u003dcompute_uuid).first()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_07d08f52","line":239,"in_reply_to":"ba5201f7_109b6e73","updated":"2017-01-11 13:48:29.000000000","message":"I think we agreed to stop amending the DB API for single CRUD operations and do all the ORM wirings within the object itself.\n\nUsing a single DB API for that is a legacy of the past when we had no objects and I don\u0027t see a reason why we should keep that behaviour.","commit_id":"02d3e1613df040302ce4f5917fae604a2cca653f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"5bea8a2443b6aba442158ee0e86145ca5a674980","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        return cls._from_db_object(context, cls(), db_compute)"},{"line_number":237,"context_line":""},{"line_number":238,"context_line":"    @staticmethod"},{"line_number":239,"context_line":"    @sqla_api.main_context_manager.reader"},{"line_number":240,"context_line":"    def _get_by_compute_node_uuid_from_db(context, compute_uuid):"},{"line_number":241,"context_line":"        db_compute \u003d context.session.query(models.ComputeNode).filter_by("},{"line_number":242,"context_line":"            uuid\u003dcompute_uuid).first()"}],"source_content_type":"text/x-python","patch_set":1,"id":"ba5201f7_8706351a","line":239,"in_reply_to":"ba5201f7_35de9211","updated":"2017-01-11 16:30:19.000000000","message":"Consistency is a nice thing, especially as in this case by not having consistency we are increasing the number of collaborating modules this module has.\n\nBut I don\u0027t care enough to be all -1 about it.","commit_id":"02d3e1613df040302ce4f5917fae604a2cca653f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"78f096cb88cb98669f9e947284d39384f769087b","unresolved":false,"context_lines":[{"line_number":241,"context_line":"        db_compute \u003d context.session.query(models.ComputeNode).filter_by("},{"line_number":242,"context_line":"            uuid\u003dcompute_uuid).first()"},{"line_number":243,"context_line":"        if not db_compute:"},{"line_number":244,"context_line":"            raise exception.ComputeHostNotFound(uuid\u003dcompute_uuid)"},{"line_number":245,"context_line":"        return db_compute"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    @base.remotable_classmethod"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_1269ba8b","line":244,"range":{"start_line":244,"start_character":48,"end_line":244,"end_character":52},"updated":"2017-01-16 16:06:23.000000000","message":"This isn\u0027t a kwarg into the msg_fmt for this exception type, the kwarg is host.","commit_id":"0f0076c4b3a61994f4b6b08bb324746cd5ec8eb9"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b93361e3401718fd922649fda3effcdc2b8b0f8f","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    # Version 1.14: Added cpu_allocation_ratio and ram_allocation_ratio"},{"line_number":52,"context_line":"    # Version 1.15: Added uuid"},{"line_number":53,"context_line":"    # Version 1.16: Added disk_allocation_ratio"},{"line_number":54,"context_line":"    # Version 1.17: Added get_by_uuid()"},{"line_number":55,"context_line":"    VERSION \u003d \u00271.17\u0027"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    fields \u003d {"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a3c09a3_b367d0e7","line":54,"updated":"2017-01-17 16:09:47.000000000","message":"this is no longer correct, needs to be get_all_by_uuids","commit_id":"d336137b01ae4214b451e0051dd21bd390c933c8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"480d18c189aef05bc4af891a33481e9d81e1fc61","unresolved":false,"context_lines":[{"line_number":404,"context_line":"                                  db_computes)"},{"line_number":405,"context_line":""},{"line_number":406,"context_line":"    @staticmethod"},{"line_number":407,"context_line":"    @db.select_db_reader_mode"},{"line_number":408,"context_line":"    def _db_compute_node_get_all_by_host(context, host, use_slave\u003dFalse):"},{"line_number":409,"context_line":"        return db.compute_node_get_all_by_host(context, host)"},{"line_number":410,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_a0883b72","line":407,"updated":"2017-01-17 23:20:01.000000000","message":"I was looking at this which it looks like you could also use, I think when it comes down to it they are the same as what you\u0027re using below for the reader context manager.","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"}],"nova/tests/functional/db/test_compute_node.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b93361e3401718fd922649fda3effcdc2b8b0f8f","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                                                          [self.compute_uuid])"},{"line_number":102,"context_line":"        self.assertEqual(0, len(db_cns))"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def test_get_by_uuid(self):"},{"line_number":105,"context_line":"        cn \u003d self._create_compute_node()"},{"line_number":106,"context_line":"        db_cns \u003d objects.ComputeNodeList.get_all_by_uuids(self.context,"},{"line_number":107,"context_line":"                                                          [self.compute_uuid])"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a3c09a3_f3b95816","line":104,"updated":"2017-01-17 16:09:47.000000000","message":"the name of the test doesn\u0027t seem ideal, now, nor the one above","commit_id":"d336137b01ae4214b451e0051dd21bd390c933c8"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4212e27a088badc31563d29260c2ed58d56cc5fe","unresolved":false,"context_lines":[{"line_number":101,"context_line":"                                                          [self.compute_uuid])"},{"line_number":102,"context_line":"        self.assertEqual(0, len(db_cns))"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"    def test_get_by_uuid(self):"},{"line_number":105,"context_line":"        cn \u003d self._create_compute_node()"},{"line_number":106,"context_line":"        db_cns \u003d objects.ComputeNodeList.get_all_by_uuids(self.context,"},{"line_number":107,"context_line":"                                                          [self.compute_uuid])"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a3c09a3_b0afb07b","line":104,"in_reply_to":"7a3c09a3_f3b95816","updated":"2017-01-17 22:05:56.000000000","message":"Right, I forgot to modify those.","commit_id":"d336137b01ae4214b451e0051dd21bd390c933c8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f24319828c307f5f6c4b3d38fc312aadce52011e","unresolved":false,"context_lines":[{"line_number":36,"context_line":"}"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":"fake_compute_obj \u003d objects.ComputeNode("},{"line_number":39,"context_line":"    uuid\u003duuidsentinel.fake_compute_node,"},{"line_number":40,"context_line":"    host\u003d_HOSTNAME,"},{"line_number":41,"context_line":"    vcpus\u003d_VIRT_DRIVER_AVAIL_RESOURCES[\u0027vcpus\u0027],"},{"line_number":42,"context_line":"    memory_mb\u003d_VIRT_DRIVER_AVAIL_RESOURCES[\u0027memory_mb\u0027],"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_40add786","line":39,"updated":"2017-01-17 23:27:42.000000000","message":"Remove this since you aren\u0027t relying on this...","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"480d18c189aef05bc4af891a33481e9d81e1fc61","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"class ComputeNodeTestCase(test.NoDBTestCase):"},{"line_number":77,"context_line":"    USES_DB_SELF \u003d True"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def setUp(self):"},{"line_number":80,"context_line":"        super(ComputeNodeTestCase, self).setUp()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_80617fab","line":77,"updated":"2017-01-17 23:20:01.000000000","message":"Since we\u0027re not caring about cells or the API DB in these tests, this is not really necessary and you could just extend test.TestCase and don\u0027t need to worry about the database fixture.","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"480d18c189aef05bc4af891a33481e9d81e1fc61","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        super(ComputeNodeTestCase, self).setUp()"},{"line_number":81,"context_line":"        self.useFixture(fixtures.Database())"},{"line_number":82,"context_line":"        self.context \u003d context.RequestContext(\u0027fake-user\u0027, \u0027fake-project\u0027)"},{"line_number":83,"context_line":"        self.compute_obj \u003d objects.ComputeNode()"},{"line_number":84,"context_line":"        self.compute_uuid \u003d None"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def _create_compute_node(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_406cf79b","line":83,"updated":"2017-01-17 23:20:01.000000000","message":"This isn\u0027t used anywhere.","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e13998ae7f0fa787afb27995c7bf1f8354066708","unresolved":false,"context_lines":[{"line_number":80,"context_line":"        super(ComputeNodeTestCase, self).setUp()"},{"line_number":81,"context_line":"        self.useFixture(fixtures.Database())"},{"line_number":82,"context_line":"        self.context \u003d context.RequestContext(\u0027fake-user\u0027, \u0027fake-project\u0027)"},{"line_number":83,"context_line":"        self.compute_obj \u003d objects.ComputeNode()"},{"line_number":84,"context_line":"        self.compute_uuid \u003d None"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def _create_compute_node(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_cecd6a67","line":83,"in_reply_to":"7a3c09a3_406cf79b","updated":"2017-01-18 08:26:50.000000000","message":"Yeah, forgot to cut it when I changed into get_all_by_uuids","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"480d18c189aef05bc4af891a33481e9d81e1fc61","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        del compute_obj.uuid"},{"line_number":91,"context_line":"        compute_obj.obj_reset_changes(fields\u003d[\u0027uuid\u0027])"},{"line_number":92,"context_line":"        compute_obj.create()"},{"line_number":93,"context_line":"        self.compute_uuid \u003d compute_obj.uuid"},{"line_number":94,"context_line":"        return compute_obj"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def test_get_all_by_uuids_not_found(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_80089fdb","line":93,"updated":"2017-01-17 23:20:01.000000000","message":"This seems unnecessary with how this test uses this thing, it returns the compute node that was created, which you can just use in the test with member variables on the class instance.","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e13998ae7f0fa787afb27995c7bf1f8354066708","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        del compute_obj.uuid"},{"line_number":91,"context_line":"        compute_obj.obj_reset_changes(fields\u003d[\u0027uuid\u0027])"},{"line_number":92,"context_line":"        compute_obj.create()"},{"line_number":93,"context_line":"        self.compute_uuid \u003d compute_obj.uuid"},{"line_number":94,"context_line":"        return compute_obj"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def test_get_all_by_uuids_not_found(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_0edbf21b","line":93,"in_reply_to":"7a3c09a3_0043cfb2","updated":"2017-01-18 08:26:50.000000000","message":"Agreed. The previous (that I forgot to upload) was having a different test because I was verifying the exception, but now it\u0027s no longer needed.","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f24319828c307f5f6c4b3d38fc312aadce52011e","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        del compute_obj.uuid"},{"line_number":91,"context_line":"        compute_obj.obj_reset_changes(fields\u003d[\u0027uuid\u0027])"},{"line_number":92,"context_line":"        compute_obj.create()"},{"line_number":93,"context_line":"        self.compute_uuid \u003d compute_obj.uuid"},{"line_number":94,"context_line":"        return compute_obj"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":"    def test_get_all_by_uuids_not_found(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_0043cfb2","line":93,"in_reply_to":"7a3c09a3_80089fdb","updated":"2017-01-17 23:27:42.000000000","message":"Yeah, I don\u0027t really see much need for this either. Just put a couple compute node creations into the test_get_all_by_uuids() method:\n\n test_get_all_by_uuids(self):\n     cn1 \u003d fake_compute_obj.obj_clone()\n     cn1._context \u003d self.context\n     cn1.create()\n\n     cn2 \u003d fake_compute_obj.obj_clone()\n     cn2._context \u003d self.context\n     cn2.create()\n\n     cns \u003d objects.ComputeNodeList.get_all_by_uuids(self.context)\n     self.assertEqual(0, len(cns))\n\n     objects.ComputeNodeList.get_all_by_uuids(self.context,\n                                              [cn1.uuid, cn2.uuid])\n     self.assertEqual(2, len(cns))\n\n     # Ensure that asking for a non-existing UUID along with\n     # existing UUIDs doesn\u0027t limit the return of the existing\n     # compute nodes...\n     objects.ComputeNodeList.get_all_by_uuids(self.context,\n                                              [cn1.uuid, cn2.uuid,\n                                               uuidsentinel.noexist])\n     self.assertEqual(2, len(cns))","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"480d18c189aef05bc4af891a33481e9d81e1fc61","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                                                          [self.compute_uuid])"},{"line_number":99,"context_line":"        self.assertEqual(0, len(db_cns))"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def test_get_all_by_uuids(self):"},{"line_number":102,"context_line":"        cn \u003d self._create_compute_node()"},{"line_number":103,"context_line":"        db_cns \u003d objects.ComputeNodeList.get_all_by_uuids(self.context,"},{"line_number":104,"context_line":"                                                          [self.compute_uuid])"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_20f8cbc2","line":101,"updated":"2017-01-17 23:20:01.000000000","message":"This test would be more interesting to me if you created more than one compute node, OR if you passed in the real compute node uuid and a fake compute node uuid that doesn\u0027t exist.","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e13998ae7f0fa787afb27995c7bf1f8354066708","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                                                          [self.compute_uuid])"},{"line_number":99,"context_line":"        self.assertEqual(0, len(db_cns))"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def test_get_all_by_uuids(self):"},{"line_number":102,"context_line":"        cn \u003d self._create_compute_node()"},{"line_number":103,"context_line":"        db_cns \u003d objects.ComputeNodeList.get_all_by_uuids(self.context,"},{"line_number":104,"context_line":"                                                          [self.compute_uuid])"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_cefbaa77","line":101,"in_reply_to":"7a3c09a3_00d2ef27","updated":"2017-01-18 08:26:50.000000000","message":"Right, again because I first created this testcase only for get_by_uuid. I\u0027ll modify that.","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f24319828c307f5f6c4b3d38fc312aadce52011e","unresolved":false,"context_lines":[{"line_number":98,"context_line":"                                                          [self.compute_uuid])"},{"line_number":99,"context_line":"        self.assertEqual(0, len(db_cns))"},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"    def test_get_all_by_uuids(self):"},{"line_number":102,"context_line":"        cn \u003d self._create_compute_node()"},{"line_number":103,"context_line":"        db_cns \u003d objects.ComputeNodeList.get_all_by_uuids(self.context,"},{"line_number":104,"context_line":"                                                          [self.compute_uuid])"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_00d2ef27","line":101,"in_reply_to":"7a3c09a3_20f8cbc2","updated":"2017-01-17 23:27:42.000000000","message":"agreed.","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"90cd87807d4a42886f8930fbf6415041d0c5158a","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        cn1.create()"},{"line_number":83,"context_line":"        cn2 \u003d fake_compute_obj.obj_clone()"},{"line_number":84,"context_line":"        cn2._context \u003d self.context"},{"line_number":85,"context_line":"        # Two compute nodes can\u0027t have the same tuple (host, node, deleted)"},{"line_number":86,"context_line":"        cn2.host \u003d _HOSTNAME + \u00272\u0027"},{"line_number":87,"context_line":"        cn2.create()"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"        cns \u003d objects.ComputeNodeList.get_all_by_uuids(self.context, [])"},{"line_number":90,"context_line":"        self.assertEqual(0, len(cns))"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a3c09a3_2ef87cc4","line":87,"range":{"start_line":85,"start_character":8,"end_line":87,"end_character":20},"updated":"2017-01-18 20:58:07.000000000","message":"nit: I would have just had a _create_compute_node helper method that clones the fake one above and sets the host field to be a random uuid, then we don\u0027t need to worry about stuff like this. But meh.","commit_id":"a82e2b4d8efcfb812c867b0682c999199384e89f"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"06dd07befed82ad34516c829841a9d299238aac8","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        cns \u003d objects.ComputeNodeList.get_all_by_uuids(self.context,"},{"line_number":100,"context_line":"                                                       [cn1.uuid, cn2.uuid,"},{"line_number":101,"context_line":"                                                        uuidsentinel.noexists])"},{"line_number":102,"context_line":"        self.assertEqual(2, len(cns))"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a3c09a3_8bc7bb62","line":102,"updated":"2017-01-18 15:05:02.000000000","message":"These tests all return either all or none. I would prefer to see a test that filtered the set of compute nodes by a uuid. In this case, it would be simple to pass in just one of the uuids, and verify that you did indeed get back just the one that matched.","commit_id":"a82e2b4d8efcfb812c867b0682c999199384e89f"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"18c9eb985c547d3a57e27cc2b979fb1912b14a3c","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        cns \u003d objects.ComputeNodeList.get_all_by_uuids(self.context,"},{"line_number":100,"context_line":"                                                       [cn1.uuid, cn2.uuid,"},{"line_number":101,"context_line":"                                                        uuidsentinel.noexists])"},{"line_number":102,"context_line":"        self.assertEqual(2, len(cns))"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a3c09a3_91760c04","line":102,"in_reply_to":"7a3c09a3_8bc7bb62","updated":"2017-01-18 15:29:43.000000000","message":"The last one is doing that actually... We pass 3 uuids, we only get 2 of those.","commit_id":"a82e2b4d8efcfb812c867b0682c999199384e89f"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"89e53743df9c9e3ed7d8a18ac58a4bd6cc95d897","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        cns \u003d objects.ComputeNodeList.get_all_by_uuids(self.context,"},{"line_number":100,"context_line":"                                                       [cn1.uuid, cn2.uuid,"},{"line_number":101,"context_line":"                                                        uuidsentinel.noexists])"},{"line_number":102,"context_line":"        self.assertEqual(2, len(cns))"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a3c09a3_0ea900e0","line":102,"in_reply_to":"7a3c09a3_91760c04","updated":"2017-01-18 20:54:44.000000000","message":"I meant all compute nodes, or none. I\u0027d like to see passing in one of the compute node UUIDs, and only getting that one back.","commit_id":"a82e2b4d8efcfb812c867b0682c999199384e89f"}],"nova/tests/unit/objects/test_compute_node.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e6556b24497b399fce81757cf3810d9f2be2b7f9","unresolved":false,"context_lines":[{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    @mock.patch.object(objects.ComputeNode,"},{"line_number":186,"context_line":"                       \u0027_get_by_compute_node_uuid_from_db\u0027)"},{"line_number":187,"context_line":"    def test_get_by_uuid(self, get_by_uuid):"},{"line_number":188,"context_line":"        get_by_uuid.return_value \u003d fake_compute_node"},{"line_number":189,"context_line":"        cn \u003d objects.ComputeNode.get_by_uuid(self.context,"},{"line_number":190,"context_line":"                                             fake_compute_node[\u0027uuid\u0027])"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_72ff5e67","line":187,"range":{"start_line":187,"start_character":31,"end_line":187,"end_character":42},"updated":"2017-01-16 16:09:43.000000000","message":"Should we assert how this was called?","commit_id":"0f0076c4b3a61994f4b6b08bb324746cd5ec8eb9"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"480d18c189aef05bc4af891a33481e9d81e1fc61","unresolved":false,"context_lines":[{"line_number":408,"context_line":"                         subs\u003dself.subs(),"},{"line_number":409,"context_line":"                         comparators\u003dself.comparators())"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"    @mock.patch.object(objects.ComputeNodeList,"},{"line_number":412,"context_line":"                       \u0027_db_compute_node_get_all_by_uuids\u0027)"},{"line_number":413,"context_line":"    def test_get_all_by_uuids(self, get_all_by_uuids):"},{"line_number":414,"context_line":"        get_all_by_uuids.return_value \u003d [fake_compute_node]"},{"line_number":415,"context_line":"        cns \u003d objects.ComputeNodeList.get_all_by_uuids("},{"line_number":416,"context_line":"            self.context, [fake_compute_node[\u0027uuid\u0027]])"},{"line_number":417,"context_line":"        get_all_by_uuids.assert_called_once_with(self.context,"},{"line_number":418,"context_line":"                                                 [fake_compute_node[\u0027uuid\u0027]])"},{"line_number":419,"context_line":"        self.assertEqual(1, len(cns))"},{"line_number":420,"context_line":"        self.assertIsInstance(cns[0], objects.ComputeNode)"},{"line_number":421,"context_line":"        self.assertEqual(fake_compute_node[\u0027uuid\u0027], cns[0].uuid)"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"    @mock.patch.object(objects.ComputeNodeList,"},{"line_number":424,"context_line":"                       \u0027_db_compute_node_get_all_by_uuids\u0027)"},{"line_number":425,"context_line":"    def test_get_all_by_uuids_not_found(self, get_all_by_uuids):"},{"line_number":426,"context_line":"        get_all_by_uuids.return_value \u003d []"},{"line_number":427,"context_line":"        cns \u003d objects.ComputeNodeList.get_all_by_uuids("},{"line_number":428,"context_line":"            self.context, [fake_compute_node[\u0027uuid\u0027]])"},{"line_number":429,"context_line":"        self.assertEqual(0, len(cns))"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":"    def test_compat_numa_topology(self):"},{"line_number":432,"context_line":"        compute \u003d compute_node.ComputeNode()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_201feb08","line":429,"range":{"start_line":411,"start_character":0,"end_line":429,"end_character":37},"updated":"2017-01-17 23:20:01.000000000","message":"These are redundant with the functional tests that use a real database (well, as real as sqlite gets) so I wouldn\u0027t even bother.","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"e13998ae7f0fa787afb27995c7bf1f8354066708","unresolved":false,"context_lines":[{"line_number":408,"context_line":"                         subs\u003dself.subs(),"},{"line_number":409,"context_line":"                         comparators\u003dself.comparators())"},{"line_number":410,"context_line":""},{"line_number":411,"context_line":"    @mock.patch.object(objects.ComputeNodeList,"},{"line_number":412,"context_line":"                       \u0027_db_compute_node_get_all_by_uuids\u0027)"},{"line_number":413,"context_line":"    def test_get_all_by_uuids(self, get_all_by_uuids):"},{"line_number":414,"context_line":"        get_all_by_uuids.return_value \u003d [fake_compute_node]"},{"line_number":415,"context_line":"        cns \u003d objects.ComputeNodeList.get_all_by_uuids("},{"line_number":416,"context_line":"            self.context, [fake_compute_node[\u0027uuid\u0027]])"},{"line_number":417,"context_line":"        get_all_by_uuids.assert_called_once_with(self.context,"},{"line_number":418,"context_line":"                                                 [fake_compute_node[\u0027uuid\u0027]])"},{"line_number":419,"context_line":"        self.assertEqual(1, len(cns))"},{"line_number":420,"context_line":"        self.assertIsInstance(cns[0], objects.ComputeNode)"},{"line_number":421,"context_line":"        self.assertEqual(fake_compute_node[\u0027uuid\u0027], cns[0].uuid)"},{"line_number":422,"context_line":""},{"line_number":423,"context_line":"    @mock.patch.object(objects.ComputeNodeList,"},{"line_number":424,"context_line":"                       \u0027_db_compute_node_get_all_by_uuids\u0027)"},{"line_number":425,"context_line":"    def test_get_all_by_uuids_not_found(self, get_all_by_uuids):"},{"line_number":426,"context_line":"        get_all_by_uuids.return_value \u003d []"},{"line_number":427,"context_line":"        cns \u003d objects.ComputeNodeList.get_all_by_uuids("},{"line_number":428,"context_line":"            self.context, [fake_compute_node[\u0027uuid\u0027]])"},{"line_number":429,"context_line":"        self.assertEqual(0, len(cns))"},{"line_number":430,"context_line":""},{"line_number":431,"context_line":"    def test_compat_numa_topology(self):"},{"line_number":432,"context_line":"        compute \u003d compute_node.ComputeNode()"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a3c09a3_6ebc76bb","line":429,"range":{"start_line":411,"start_character":0,"end_line":429,"end_character":37},"in_reply_to":"7a3c09a3_201feb08","updated":"2017-01-18 08:26:50.000000000","message":"Sure, it\u0027s already better covered by the functional tests, I just wanted to leave something here to make sure that we know the DB call by the UT.","commit_id":"20783e2a52a9c957dd5a1698edb59aabf69ed3ee"}]}
