)]}'
{"ironic/tests/api/utils.py":[{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"a7a161ab14fbaaf53bf2df09f1c846e25765440d","unresolved":false,"context_lines":[{"line_number":80,"context_line":"def node_post_data(**kw):"},{"line_number":81,"context_line":"    node \u003d utils.get_test_node(**kw)"},{"line_number":82,"context_line":"    if \u0027id\u0027 not in kw:"},{"line_number":83,"context_line":"        del node[\u0027id\u0027]"},{"line_number":84,"context_line":"    internal \u003d node_controller.NodePatchType.internal_attrs()"},{"line_number":85,"context_line":"    return remove_internal(node, internal)"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_6ba00691","line":83,"updated":"2014-10-21 13:09:39.000000000","message":"No need to add this, id is listed in JsonPatchType.internal_attrs(), which is called in NodePatchType.internal_attrs().","commit_id":"ed65c157eda8edd64da0e22cf4f47af9daeba8c5"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"944a0bd42209bfaf607d20a136926334790f61b5","unresolved":false,"context_lines":[{"line_number":80,"context_line":"def node_post_data(**kw):"},{"line_number":81,"context_line":"    node \u003d utils.get_test_node(**kw)"},{"line_number":82,"context_line":"    if \u0027id\u0027 not in kw:"},{"line_number":83,"context_line":"        del node[\u0027id\u0027]"},{"line_number":84,"context_line":"    internal \u003d node_controller.NodePatchType.internal_attrs()"},{"line_number":85,"context_line":"    return remove_internal(node, internal)"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9aa7fdbe_6b7486cf","line":83,"in_reply_to":"9aa7fdbe_6ba00691","updated":"2014-10-21 13:21:11.000000000","message":"Yes, line 85.","commit_id":"ed65c157eda8edd64da0e22cf4f47af9daeba8c5"}],"ironic/tests/api/v1/test_nodes.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"7952dd2f0fcd3a00064be81edf838cfcde09bc1e","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        #created some associated nodes"},{"line_number":67,"context_line":"        associated_nodes \u003d []"},{"line_number":68,"context_line":"        for id in range(3, 7):"},{"line_number":69,"context_line":"            node \u003d obj_utils.create_test_node("},{"line_number":70,"context_line":"                    self.context, uuid\u003dutils.generate_uuid(),"},{"line_number":71,"context_line":"                    instance_uuid\u003dutils.generate_uuid())"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_c1044980","line":68,"updated":"2014-10-14 12:19:47.000000000","message":"You can use range(4) here.","commit_id":"f5407c947303351f4202cdb11181d3745f53d7e5"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"92ba64d5785064742b8799be01e0a158229a88ee","unresolved":false,"context_lines":[{"line_number":65,"context_line":""},{"line_number":66,"context_line":"        #created some associated nodes"},{"line_number":67,"context_line":"        associated_nodes \u003d []"},{"line_number":68,"context_line":"        for id in range(3, 7):"},{"line_number":69,"context_line":"            node \u003d obj_utils.create_test_node("},{"line_number":70,"context_line":"                    self.context, uuid\u003dutils.generate_uuid(),"},{"line_number":71,"context_line":"                    instance_uuid\u003dutils.generate_uuid())"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_3972a57c","line":68,"in_reply_to":"baa201ad_c1044980","updated":"2014-10-14 12:24:20.000000000","message":"+1","commit_id":"f5407c947303351f4202cdb11181d3745f53d7e5"}],"ironic/tests/api/v1/test_ports.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"7952dd2f0fcd3a00064be81edf838cfcde09bc1e","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        ports \u003d []"},{"line_number":90,"context_line":"        for id_ in range(5):"},{"line_number":91,"context_line":"            port \u003d obj_utils.create_test_port(self.context,"},{"line_number":92,"context_line":"                                            id\u003did_,"},{"line_number":93,"context_line":"                                            node_id\u003dself.node.id,"},{"line_number":94,"context_line":"                                            uuid\u003dutils.generate_uuid(),"},{"line_number":95,"context_line":"                                            address\u003d\u002752:54:00:cf:2d:3%s\u0027 % id_)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_19f7a1f6","line":92,"updated":"2014-10-14 12:19:47.000000000","message":"ditto l106","commit_id":"f5407c947303351f4202cdb11181d3745f53d7e5"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"92ba64d5785064742b8799be01e0a158229a88ee","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        ports \u003d []"},{"line_number":90,"context_line":"        for id_ in range(5):"},{"line_number":91,"context_line":"            port \u003d obj_utils.create_test_port(self.context,"},{"line_number":92,"context_line":"                                            id\u003did_,"},{"line_number":93,"context_line":"                                            node_id\u003dself.node.id,"},{"line_number":94,"context_line":"                                            uuid\u003dutils.generate_uuid(),"},{"line_number":95,"context_line":"                                            address\u003d\u002752:54:00:cf:2d:3%s\u0027 % id_)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_f9581dfc","line":92,"in_reply_to":"baa201ad_19f7a1f6","updated":"2014-10-14 12:24:20.000000000","message":"hi yuriy, I thin this is because its for Ports his patch is specific for Nodes. The patch is partially fixing the problem","commit_id":"f5407c947303351f4202cdb11181d3745f53d7e5"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"f1fbb180f1756864cc2f612c3bff7b9f28ed8925","unresolved":false,"context_lines":[{"line_number":89,"context_line":"        ports \u003d []"},{"line_number":90,"context_line":"        for id_ in range(5):"},{"line_number":91,"context_line":"            port \u003d obj_utils.create_test_port(self.context,"},{"line_number":92,"context_line":"                                            id\u003did_,"},{"line_number":93,"context_line":"                                            node_id\u003dself.node.id,"},{"line_number":94,"context_line":"                                            uuid\u003dutils.generate_uuid(),"},{"line_number":95,"context_line":"                                            address\u003d\u002752:54:00:cf:2d:3%s\u0027 % id_)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_b92cd54b","line":92,"in_reply_to":"baa201ad_f9581dfc","updated":"2014-10-14 12:26:48.000000000","message":"Yes, left the comment already.","commit_id":"f5407c947303351f4202cdb11181d3745f53d7e5"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"7952dd2f0fcd3a00064be81edf838cfcde09bc1e","unresolved":false,"context_lines":[{"line_number":103,"context_line":"    def test_links(self):"},{"line_number":104,"context_line":"        uuid \u003d utils.generate_uuid()"},{"line_number":105,"context_line":"        obj_utils.create_test_port(self.context,"},{"line_number":106,"context_line":"                                   id\u003d1,"},{"line_number":107,"context_line":"                                   uuid\u003duuid,"},{"line_number":108,"context_line":"                                   node_id\u003dself.node.id)"},{"line_number":109,"context_line":"        data \u003d self.get_json(\u0027/ports/%s\u0027 % uuid)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_d99ef9b7","line":106,"updated":"2014-10-14 12:19:47.000000000","message":"I see \"id\" is hardcoded.","commit_id":"f5407c947303351f4202cdb11181d3745f53d7e5"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"f105720aad50fbdccc0258eeafcbf981fa1ddcf4","unresolved":false,"context_lines":[{"line_number":103,"context_line":"    def test_links(self):"},{"line_number":104,"context_line":"        uuid \u003d utils.generate_uuid()"},{"line_number":105,"context_line":"        obj_utils.create_test_port(self.context,"},{"line_number":106,"context_line":"                                   id\u003d1,"},{"line_number":107,"context_line":"                                   uuid\u003duuid,"},{"line_number":108,"context_line":"                                   node_id\u003dself.node.id)"},{"line_number":109,"context_line":"        data \u003d self.get_json(\u0027/ports/%s\u0027 % uuid)"}],"source_content_type":"text/x-python","patch_set":1,"id":"baa201ad_9950f1d5","line":106,"in_reply_to":"baa201ad_d99ef9b7","updated":"2014-10-14 12:23:27.000000000","message":"Ok if this patch only for node resources.","commit_id":"f5407c947303351f4202cdb11181d3745f53d7e5"}],"ironic/tests/db/test_chassis.py":[{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"519d61d1a4bfab6c15409074489d429d4db3e3e6","unresolved":false,"context_lines":[{"line_number":32,"context_line":"        return ch"},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"    def _create_test_node(self, **kwargs):"},{"line_number":35,"context_line":"        return utils.create_test_node(**kwargs)"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    def test_get_chassis_list(self):"},{"line_number":38,"context_line":"        uuids \u003d []"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_77c23454","line":35,"updated":"2014-10-16 10:04:44.000000000","message":"ditto why keeping it?","commit_id":"dcc44779a0b6836515544a4b0a489578a3f6549b"}],"ironic/tests/db/test_nodes.py":[{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"519d61d1a4bfab6c15409074489d429d4db3e3e6","unresolved":false,"context_lines":[{"line_number":30,"context_line":""},{"line_number":31,"context_line":"class DbNodeTestCase(base.DbTestCase):"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"    def _create_test_node(self, **kwargs):"},{"line_number":34,"context_line":"        node \u003d utils.create_test_node(**kwargs)"},{"line_number":35,"context_line":"        return node"},{"line_number":36,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_1769e8bd","line":33,"updated":"2014-10-16 10:04:44.000000000","message":"What\u0027s the point of keeping this method now?","commit_id":"dcc44779a0b6836515544a4b0a489578a3f6549b"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"519d61d1a4bfab6c15409074489d429d4db3e3e6","unresolved":false,"context_lines":[{"line_number":141,"context_line":"        node2 \u003d utils.create_test_node(uuid\u003dironic_utils.generate_uuid(),"},{"line_number":142,"context_line":"                                       provision_state\u003dstates.DEPLOYWAIT)"},{"line_number":143,"context_line":"        # node without timeout"},{"line_number":144,"context_line":"        utils.get_test_node(uuid\u003dironic_utils.generate_uuid(),"},{"line_number":145,"context_line":"                            provision_updated_at\u003dnext)"},{"line_number":146,"context_line":""},{"line_number":147,"context_line":"        mock_utcnow.return_value \u003d present"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_f7cc64bd","line":144,"updated":"2014-10-16 10:04:44.000000000","message":"I guess this node should also be created to demonstrate it is not present in lists on L149, L153.","commit_id":"dcc44779a0b6836515544a4b0a489578a3f6549b"},{"author":{"_account_id":3099,"name":"David Shrewsbury","email":"dshrewsb@redhat.com","username":"dshrews"},"change_message_id":"8be6ec9a0c4046f02594b57419661dca47611366","unresolved":false,"context_lines":[{"line_number":323,"context_line":"    def test_update_node_provision(self, mock_utcnow):"},{"line_number":324,"context_line":"        mocked_time \u003d datetime.datetime(2000, 1, 1, 0, 0)"},{"line_number":325,"context_line":"        mock_utcnow.return_value \u003d mocked_time"},{"line_number":326,"context_line":"        n \u003d utils.create_test_node()"},{"line_number":327,"context_line":"        res \u003d self.dbapi.update_node(n[\u0027id\u0027], {\u0027provision_state\u0027: \u0027fake\u0027})"},{"line_number":328,"context_line":"        self.assertEqual(mocked_time,"},{"line_number":329,"context_line":"                         timeutils.normalize_time(res[\u0027provision_updated_at\u0027]))"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa7fdbe_49816949","line":326,"updated":"2014-10-22 11:15:18.000000000","message":"missed a s/n/node/ here, but not a big deal to me.  :)","commit_id":"f6f2315fc3e310b08133c333f6c93db4446e0063"}],"ironic/tests/db/utils.py":[{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"5f975d8e0472828eecf58c7ffabe0562c77680f2","unresolved":false,"context_lines":[{"line_number":143,"context_line":"    return result"},{"line_number":144,"context_line":""},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"def get_test_node(ignored_fields\u003d{}, **kw):"},{"line_number":147,"context_line":"    properties \u003d {"},{"line_number":148,"context_line":"        \"cpu_arch\": \"x86_64\","},{"line_number":149,"context_line":"        \"cpus\": \"8\","}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_3858bf89","line":146,"updated":"2014-10-15 10:36:40.000000000","message":"ditto l183, and also this is emty dict.","commit_id":"1dd55bb3e57b4e7ecac2e42844c06536b34fe23e"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"5f975d8e0472828eecf58c7ffabe0562c77680f2","unresolved":false,"context_lines":[{"line_number":180,"context_line":"    return node"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def create_test_node(ignored_fields\u003d{\u0027id\u0027}, **kw):"},{"line_number":184,"context_line":"    \"\"\"Create test node entry in DB and return Node DB object.\"\"\""},{"line_number":185,"context_line":"    ignored_fields \u003d ignored_fields - set(kw.keys())"},{"line_number":186,"context_line":"    node \u003d get_test_node(ignored_fields\u003dignored_fields, **kw)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_b8aaef6e","line":183,"updated":"2014-10-15 10:36:40.000000000","message":"Please do not use set as default value, see warning https://docs.python.org/2/tutorial/controlflow.html#default-argument-values","commit_id":"1dd55bb3e57b4e7ecac2e42844c06536b34fe23e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"03e77bd508a9db79aaf250459ccded0978487590","unresolved":false,"context_lines":[{"line_number":180,"context_line":"    return node"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def create_test_node(ignored_fields\u003d{\u0027id\u0027}, **kw):"},{"line_number":184,"context_line":"    \"\"\"Create test node entry in DB and return Node DB object.\"\"\""},{"line_number":185,"context_line":"    ignored_fields \u003d ignored_fields - set(kw.keys())"},{"line_number":186,"context_line":"    node \u003d get_test_node(ignored_fields\u003dignored_fields, **kw)"}],"source_content_type":"text/x-python","patch_set":2,"id":"baa201ad_21816ac3","line":183,"in_reply_to":"baa201ad_b8aaef6e","updated":"2014-10-15 11:59:49.000000000","message":"+1\n\nHere\u0027s another great explanation why not do it http://effbot.org/zone/default-values.htm","commit_id":"1dd55bb3e57b4e7ecac2e42844c06536b34fe23e"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"abee9941e67502e23e4e491461256c147f78e637","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    }"},{"line_number":153,"context_line":"    fake_info \u003d {\"foo\": \"bar\"}"},{"line_number":154,"context_line":"    node \u003d {"},{"line_number":155,"context_line":"        \u0027id\u0027: kw.get(\u0027id\u0027, 123),"},{"line_number":156,"context_line":"        \u0027uuid\u0027: kw.get(\u0027uuid\u0027, \u00271be26c0b-03f2-4d2e-ae87-c02d7f33c123\u0027),"},{"line_number":157,"context_line":"        \u0027chassis_id\u0027: kw.get(\u0027chassis_id\u0027, 42),"},{"line_number":158,"context_line":"        \u0027conductor_affinity\u0027: kw.get(\u0027conductor_affinity\u0027, None),"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_dc6f9990","line":155,"updated":"2014-10-15 17:11:44.000000000","message":"This seems to be the crux of the matter. Instead of having ignored_fields (because the code seems to be \u0027special-casing\u0027 ids), what about just changing this. eg if and only if \u0027id\u0027 is in kw, do you set \u0027id\u0027 to it. It looks to me like you\u0027ve removed explicit setting of the id value, so this way it is only set if someone explicitly sets it.\n\nI think that\u0027d make it easier to understand. Eg, I was trying to figure out how one would be able to specify the id value, with the changes you made, and if it is possible, it isn\u0027t obvious.","commit_id":"dcc44779a0b6836515544a4b0a489578a3f6549b"},{"author":{"_account_id":10392,"name":"Dmitry Nikishov","email":"dnikishov@mirantis.com","username":"dnikishov"},"change_message_id":"ffd88b97323eafc9cd2d0d22362c882a2f3a2b4b","unresolved":false,"context_lines":[{"line_number":152,"context_line":"    }"},{"line_number":153,"context_line":"    fake_info \u003d {\"foo\": \"bar\"}"},{"line_number":154,"context_line":"    node \u003d {"},{"line_number":155,"context_line":"        \u0027id\u0027: kw.get(\u0027id\u0027, 123),"},{"line_number":156,"context_line":"        \u0027uuid\u0027: kw.get(\u0027uuid\u0027, \u00271be26c0b-03f2-4d2e-ae87-c02d7f33c123\u0027),"},{"line_number":157,"context_line":"        \u0027chassis_id\u0027: kw.get(\u0027chassis_id\u0027, 42),"},{"line_number":158,"context_line":"        \u0027conductor_affinity\u0027: kw.get(\u0027conductor_affinity\u0027, None),"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_420662cf","line":155,"in_reply_to":"baa201ad_dc6f9990","updated":"2014-10-15 18:23:59.000000000","message":"To simply set \u0027id\u0027 field only if it\u0027s present in kw was the very first approach I\u0027ve tried. This didn\u0027t work out well because there are certain tests (node object tests: https://github.com/openstack/ironic/blob/master/ironic/tests/objects/test_node.py) that use this method to mock database\u0027s response. These tests actually expect the response to contain \u0027id\u0027 field, otherwise they will produce the KeyError. So this approach would only lead to the need of hardcoding id values in some places while removing them in others.\n\nTo help with that, create_test_node() has been introduced to be used instead of db_utils.get_test_node() + dbapi.create_node() combo used in many db tests. It creates a node object in the DB allowing the database itself to choose primary key, unless kw specifically contains \u0027id\u0027 field. So even though I\u0027m not sure there is a case when setting a specific ID is absolutely necessary, this scheme allowes it. One would just need to call db_utils.create_test_node(id\u003dhardcoded_id) to do that.","commit_id":"dcc44779a0b6836515544a4b0a489578a3f6549b"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"b1d7005d1a84e2dc371cf71c51228b55a704d587","unresolved":false,"context_lines":[{"line_number":177,"context_line":"    }"},{"line_number":178,"context_line":"    # Remove fields that shouldn\u0027t be included"},{"line_number":179,"context_line":"    if ignored_fields:"},{"line_number":180,"context_line":"        map(lambda field: node.pop(field, None), ignored_fields)"},{"line_number":181,"context_line":"    return node"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_0fb80cc7","line":180,"updated":"2014-10-15 14:25:17.000000000","message":"Dmitry, combination of \"pure-functional\" map() and \"impure\" pop() in one-liner looks not very good, also map() return value not used. This is only my personal opinion, no -1.","commit_id":"dcc44779a0b6836515544a4b0a489578a3f6549b"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"abee9941e67502e23e4e491461256c147f78e637","unresolved":false,"context_lines":[{"line_number":177,"context_line":"    }"},{"line_number":178,"context_line":"    # Remove fields that shouldn\u0027t be included"},{"line_number":179,"context_line":"    if ignored_fields:"},{"line_number":180,"context_line":"        map(lambda field: node.pop(field, None), ignored_fields)"},{"line_number":181,"context_line":"    return node"},{"line_number":182,"context_line":""},{"line_number":183,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_5cd9e955","line":180,"in_reply_to":"baa201ad_0fb80cc7","updated":"2014-10-15 17:11:44.000000000","message":"I\u0027d also prefer a different way.","commit_id":"dcc44779a0b6836515544a4b0a489578a3f6549b"},{"author":{"_account_id":10392,"name":"Dmitry Nikishov","email":"dnikishov@mirantis.com","username":"dnikishov"},"change_message_id":"4c254d7e2941d425e50db524976ce334080e1caf","unresolved":false,"context_lines":[{"line_number":185,"context_line":"    \"\"\"Create test node entry in DB and return Node DB object.\"\"\""},{"line_number":186,"context_line":"    if ignored_fields is None:"},{"line_number":187,"context_line":"        ignored_fields \u003d set([\u0027id\u0027])"},{"line_number":188,"context_line":"    ignored_fields \u003d ignored_fields - set(kw.keys())"},{"line_number":189,"context_line":"    node \u003d get_test_node(ignored_fields\u003dignored_fields, **kw)"},{"line_number":190,"context_line":"    dbapi \u003d db_api.get_instance()"},{"line_number":191,"context_line":"    return dbapi.create_node(node)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_afcf0055","line":188,"updated":"2014-10-15 14:28:06.000000000","message":"It could actually expect \"ignored_attributes\" to be a list and convert it to set right here. Then we wouldn\u0027t need to build a set from ignored fields before passing them to create_test_node. What do you think?","commit_id":"dcc44779a0b6836515544a4b0a489578a3f6549b"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"519d61d1a4bfab6c15409074489d429d4db3e3e6","unresolved":false,"context_lines":[{"line_number":185,"context_line":"    \"\"\"Create test node entry in DB and return Node DB object.\"\"\""},{"line_number":186,"context_line":"    if ignored_fields is None:"},{"line_number":187,"context_line":"        ignored_fields \u003d set([\u0027id\u0027])"},{"line_number":188,"context_line":"    ignored_fields \u003d ignored_fields - set(kw.keys())"},{"line_number":189,"context_line":"    node \u003d get_test_node(ignored_fields\u003dignored_fields, **kw)"},{"line_number":190,"context_line":"    dbapi \u003d db_api.get_instance()"},{"line_number":191,"context_line":"    return dbapi.create_node(node)"}],"source_content_type":"text/x-python","patch_set":3,"id":"baa201ad_f7b8e476","line":188,"in_reply_to":"baa201ad_afcf0055","updated":"2014-10-16 10:04:44.000000000","message":"Type of ignored_fields should be added to docstring to be clear. Maybe indeed it\u0027s better to be a list.","commit_id":"dcc44779a0b6836515544a4b0a489578a3f6549b"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"ae09a8ce0dd2dfea99acc2506f632d3a8e771a73","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"# (dnikishov) Currently there is only one test case that"},{"line_number":197,"context_line":"# drops any field other than \u0027id\u0027."},{"line_number":198,"context_line":"def create_test_node_without_chassis_id(**kw):"},{"line_number":199,"context_line":"    \"\"\"Create test node without chassis id entry in DB and return DB object."},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    Function to be used to create test Node objects without chassis_id"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_3c748a98","line":198,"updated":"2014-10-21 09:42:37.000000000","message":"Not sure about that, but maybe better to add some flag to create_test_node rather then have separate method?","commit_id":"dbb1c051fe9f865ef7a415ce64533e6f151fb019"},{"author":{"_account_id":10392,"name":"Dmitry Nikishov","email":"dnikishov@mirantis.com","username":"dnikishov"},"change_message_id":"5ab0ea6572c918619752ece9f592c9211dc038fb","unresolved":false,"context_lines":[{"line_number":195,"context_line":""},{"line_number":196,"context_line":"# (dnikishov) Currently there is only one test case that"},{"line_number":197,"context_line":"# drops any field other than \u0027id\u0027."},{"line_number":198,"context_line":"def create_test_node_without_chassis_id(**kw):"},{"line_number":199,"context_line":"    \"\"\"Create test node without chassis id entry in DB and return DB object."},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    Function to be used to create test Node objects without chassis_id"}],"source_content_type":"text/x-python","patch_set":7,"id":"9aa7fdbe_ffbf54ce","line":198,"in_reply_to":"9aa7fdbe_3c748a98","updated":"2014-10-21 10:45:37.000000000","message":"I did some digging around sqlalchemy, and it seems that we can just pass \u0027chassis_id\u003dNone\u0027 to create_test_node(). This essentially will emulate setting chassis_id to NULL in the DB without any need for a dedicated method or hardcoded flags.","commit_id":"dbb1c051fe9f865ef7a415ce64533e6f151fb019"},{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"47416f3e6c199ae739bcab847cda1a7dbcdc2be8","unresolved":false,"context_lines":[{"line_number":188,"context_line":"    \"\"\""},{"line_number":189,"context_line":"    node \u003d get_test_node(**kw)"},{"line_number":190,"context_line":"    if \u0027id\u0027 not in kw:"},{"line_number":191,"context_line":"        del node[\u0027id\u0027]"},{"line_number":192,"context_line":"    dbapi \u003d db_api.get_instance()"},{"line_number":193,"context_line":"    return dbapi.create_node(node)"},{"line_number":194,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa7fdbe_e66d0334","line":191,"updated":"2014-10-21 19:21:49.000000000","message":"if you do another revision -- just wondering if it is worth putting a comment here as to why we\u0027re doing this. eg \u0027Let the DB generate the id, unless it is explicitly specified\u0027.","commit_id":"f6f2315fc3e310b08133c333f6c93db4446e0063"}],"ironic/tests/objects/utils.py":[{"author":{"_account_id":6618,"name":"Ruby Loo","email":"opensrloo@gmail.com","username":"rloo"},"change_message_id":"47416f3e6c199ae739bcab847cda1a7dbcdc2be8","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    \"\"\""},{"line_number":27,"context_line":"    db_node \u003d db_utils.get_test_node(**kw)"},{"line_number":28,"context_line":"    if \u0027id\u0027 not in kw:"},{"line_number":29,"context_line":"        del db_node[\u0027id\u0027]"},{"line_number":30,"context_line":"    node \u003d objects.Node(ctxt)"},{"line_number":31,"context_line":"    for key in db_node:"},{"line_number":32,"context_line":"        setattr(node, key, db_node[key])"}],"source_content_type":"text/x-python","patch_set":9,"id":"9aa7fdbe_e6542356","line":29,"updated":"2014-10-21 19:21:49.000000000","message":"ditto","commit_id":"f6f2315fc3e310b08133c333f6c93db4446e0063"}]}
