)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"87547d31a84cc2d82bf63bebfa4dd5514b9533e3","unresolved":false,"context_lines":[{"line_number":9,"context_line":"It turns out that BuildRequest was going to need to copy quite a bit of"},{"line_number":10,"context_line":"the Instance fields and was starting to look very similar. Instead of"},{"line_number":11,"context_line":"continuing to add fields to BuildRequest let\u0027s just store a serialized"},{"line_number":12,"context_line":"Instance in there so everything is available."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Note that the BuildRequest object version is not being bumped because"},{"line_number":15,"context_line":"this object is not yet passed over the wire anywhere or looked up"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"1a122d0e_87329af0","line":12,"updated":"2016-04-19 21:34:18.000000000","message":"I\u0027m curious specifically what Instance fields were needed by the BuildRequest. Some of the Instance\u0027s attributes are actually *not* stored in the instances cell DB table(s) -- they are stored in things like instance_extra -- particularly things like NUMA topology and PCI stats. We are actively trying to pull all such fields out of instance_extra and into the new allocations table and represent all resources in a generic, consistent fashion. I worry that having the Instance object embedded in the BuildRequest object here might make things more complicated in our efforts...","commit_id":"e26930ad79441736d9a4a62d8f943558471d2dbc"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"0e8712d98f213d79b96c65323d923e9741ae9e77","unresolved":false,"context_lines":[{"line_number":9,"context_line":"It turns out that BuildRequest was going to need to copy quite a bit of"},{"line_number":10,"context_line":"the Instance fields and was starting to look very similar. Instead of"},{"line_number":11,"context_line":"continuing to add fields to BuildRequest let\u0027s just store a serialized"},{"line_number":12,"context_line":"Instance in there so everything is available."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Note that the BuildRequest object version is not being bumped because"},{"line_number":15,"context_line":"this object is not yet passed over the wire anywhere or looked up"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":15,"id":"1a122d0e_fee5a808","line":12,"in_reply_to":"1a122d0e_87329af0","updated":"2016-04-20 15:17:41.000000000","message":"There\u0027s two categories of instance attributes that are necessary to have:\n\n1. All of the attributes necessary to fulfill an instance show/details request. That consists of what\u0027s currently in BuildRequest, some attributes from the RequestSpec relationship, and then the following attributes which this patch was adding until I switched it to just add Instance. reservation_id, launch_index, hostname, kernel_id, ramdisk_id, root_device_name, user_data.\n\n2. The attributes necessary to create the instance in the cell database after scheduling. This is mostly some additional internal details like system_metadata.\n\nBetween the two of those that\u0027s like 95% of the Instance object that needs to be available in BuildRequest. So it makes sense to just store a serialized Instance.\n\nIf NUMA topology and PCI stats are not displayed in the API, which I would hope not, and if they can be stored after scheduling has occurred, then they\u0027ll basically be ignored here. Also keep in mind that this is about storing a serialized Instance object, not creating a relationship to any instance related database tables. And that BuildRequest is short lived and only exists between the API boot request and the instance being created within a cell db.","commit_id":"e26930ad79441736d9a4a62d8f943558471d2dbc"}],"nova/compute/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"df0525842fb3023a15c613b2c67decc07c5caed6","unresolved":false,"context_lines":[{"line_number":943,"context_line":""},{"line_number":944,"context_line":"                build_request \u003d objects.BuildRequest(context,"},{"line_number":945,"context_line":"                        project_id\u003dcontext.project_id,"},{"line_number":946,"context_line":"                        instance_uuid\u003dinstance.uuid,"},{"line_number":947,"context_line":"                        instance\u003dinstance)"},{"line_number":948,"context_line":"                build_request.create()"},{"line_number":949,"context_line":"                # Create an instance_mapping.  The null cell_mapping indicates"},{"line_number":950,"context_line":"                # that the instance doesn\u0027t yet exist in a cell, and lookups"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_530440c5","line":947,"range":{"start_line":946,"start_character":24,"end_line":947,"end_character":41},"updated":"2016-04-08 15:59:01.000000000","message":"Seems weird that we have both instance_uuid and instance, but I think we have some other objects like that, like the BlockDeviceMapping object.","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"668a1058e3f8e7487003fd1a8adb3abcef36d818","unresolved":false,"context_lines":[{"line_number":943,"context_line":""},{"line_number":944,"context_line":"                build_request \u003d objects.BuildRequest(context,"},{"line_number":945,"context_line":"                        project_id\u003dcontext.project_id,"},{"line_number":946,"context_line":"                        instance_uuid\u003dinstance.uuid,"},{"line_number":947,"context_line":"                        instance\u003dinstance)"},{"line_number":948,"context_line":"                build_request.create()"},{"line_number":949,"context_line":"                # Create an instance_mapping.  The null cell_mapping indicates"},{"line_number":950,"context_line":"                # that the instance doesn\u0027t yet exist in a cell, and lookups"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_b6478a1c","line":947,"range":{"start_line":946,"start_character":24,"end_line":947,"end_character":41},"in_reply_to":"9a061dce_530440c5","updated":"2016-04-08 16:22:05.000000000","message":"This allows us to do indexed queries on the instance_uuid rather than checking the Text field for it. In order to just pass it in once and set both fields on BuildRequest I would need to add a helper method rather than using __init__.","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9bda9fba246b02b85f453e942bf405e65ade1739","unresolved":false,"context_lines":[{"line_number":943,"context_line":""},{"line_number":944,"context_line":"                build_request \u003d objects.BuildRequest(context,"},{"line_number":945,"context_line":"                        project_id\u003dcontext.project_id,"},{"line_number":946,"context_line":"                        instance_uuid\u003dinstance.uuid,"},{"line_number":947,"context_line":"                        instance\u003dinstance)"},{"line_number":948,"context_line":"                build_request.create()"},{"line_number":949,"context_line":"                # Create an instance_mapping.  The null cell_mapping indicates"},{"line_number":950,"context_line":"                # that the instance doesn\u0027t yet exist in a cell, and lookups"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_7f6c9e08","line":947,"range":{"start_line":946,"start_character":24,"end_line":947,"end_character":41},"in_reply_to":"9a061dce_b6478a1c","updated":"2016-04-08 19:22:12.000000000","message":"Ah good point on the index.","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c6600315dcb790e1274d5e76fcb0f877ead02f77","unresolved":false,"context_lines":[{"line_number":929,"context_line":"            display_name \u003d self._default_display_name(instance_uuid)"},{"line_number":930,"context_line":"        if num_instances \u003e 1:"},{"line_number":931,"context_line":"            display_name \u003d self._new_instance_name_from_template(instance_uuid,"},{"line_number":932,"context_line":"                    display_name, index)"},{"line_number":933,"context_line":"        build_request \u003d objects.BuildRequest(context,"},{"line_number":934,"context_line":"                request_spec\u003drequest_spec,"},{"line_number":935,"context_line":"                project_id\u003dcontext.project_id,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_05a1f4a9","side":"PARENT","line":932,"updated":"2016-04-15 14:48:58.000000000","message":"well, given display_name is mutable, here it was modifying it before creating the instance below L984.\n\nI\u0027m pretty sure removing that would then trample the display name, nope ?","commit_id":"d789f6eef9052a0f8ee1987e7e3ab895581f264f"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"77c89a0f8f6d9dc2fd9315370bca8f7092b810c5","unresolved":false,"context_lines":[{"line_number":929,"context_line":"            display_name \u003d self._default_display_name(instance_uuid)"},{"line_number":930,"context_line":"        if num_instances \u003e 1:"},{"line_number":931,"context_line":"            display_name \u003d self._new_instance_name_from_template(instance_uuid,"},{"line_number":932,"context_line":"                    display_name, index)"},{"line_number":933,"context_line":"        build_request \u003d objects.BuildRequest(context,"},{"line_number":934,"context_line":"                request_spec\u003drequest_spec,"},{"line_number":935,"context_line":"                project_id\u003dcontext.project_id,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_65ad4831","side":"PARENT","line":932,"in_reply_to":"1a122d0e_05a1f4a9","updated":"2016-04-15 14:55:14.000000000","message":"It modified a local copy of display_name here, but this does not affect the display_name set on the instance.","commit_id":"d789f6eef9052a0f8ee1987e7e3ab895581f264f"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4f07e848de39aa1cfff28f019261bb25932ff2c0","unresolved":false,"context_lines":[{"line_number":929,"context_line":"            display_name \u003d self._default_display_name(instance_uuid)"},{"line_number":930,"context_line":"        if num_instances \u003e 1:"},{"line_number":931,"context_line":"            display_name \u003d self._new_instance_name_from_template(instance_uuid,"},{"line_number":932,"context_line":"                    display_name, index)"},{"line_number":933,"context_line":"        build_request \u003d objects.BuildRequest(context,"},{"line_number":934,"context_line":"                request_spec\u003drequest_spec,"},{"line_number":935,"context_line":"                project_id\u003dcontext.project_id,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_08bc696b","side":"PARENT","line":932,"in_reply_to":"1a122d0e_65ad4831","updated":"2016-04-15 15:11:02.000000000","message":"Yeah, caught it.","commit_id":"d789f6eef9052a0f8ee1987e7e3ab895581f264f"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"77c89a0f8f6d9dc2fd9315370bca8f7092b810c5","unresolved":false,"context_lines":[{"line_number":1437,"context_line":""},{"line_number":1438,"context_line":"        instance.security_groups \u003d security_groups"},{"line_number":1439,"context_line":""},{"line_number":1440,"context_line":"        self._populate_instance_names(instance, num_instances)"},{"line_number":1441,"context_line":"        instance.shutdown_terminate \u003d shutdown_terminate"},{"line_number":1442,"context_line":"        if num_instances \u003e 1:"},{"line_number":1443,"context_line":"            instance \u003d self._apply_instance_name_template(context, instance,"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_0504547c","line":1440,"updated":"2016-04-15 14:55:14.000000000","message":"Sylvain: That was just copying the logic from here to set display_name on BuildRequest to match what the instance would end up getting. Since we can assume that it\u0027s set on instance correctly, as that logic hasn\u0027t changed we can just pull it from there.","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"}],"nova/db/sqlalchemy/api_migrations/migrate_repo/versions/013_build_request_extended_attrs.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"df0525842fb3023a15c613b2c67decc07c5caed6","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    request_specs \u003d Table(\u0027request_specs\u0027, meta, autoload\u003dTrue)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    for fkey in build_requests.foreign_keys:"},{"line_number":32,"context_line":"        if fkey.target_fullname \u003d\u003d \u0027request_specs.id\u0027:"},{"line_number":33,"context_line":"            ForeignKeyConstraint(columns\u003d[\u0027request_spec_id\u0027],"},{"line_number":34,"context_line":"                    refcolumns\u003d[request_specs.c.id],"},{"line_number":35,"context_line":"                    table\u003dbuild_requests,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_93dc1848","line":32,"updated":"2016-04-08 15:59:01.000000000","message":"Why are we dropping this fkey?","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"668a1058e3f8e7487003fd1a8adb3abcef36d818","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    request_specs \u003d Table(\u0027request_specs\u0027, meta, autoload\u003dTrue)"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"    for fkey in build_requests.foreign_keys:"},{"line_number":32,"context_line":"        if fkey.target_fullname \u003d\u003d \u0027request_specs.id\u0027:"},{"line_number":33,"context_line":"            ForeignKeyConstraint(columns\u003d[\u0027request_spec_id\u0027],"},{"line_number":34,"context_line":"                    refcolumns\u003d[request_specs.c.id],"},{"line_number":35,"context_line":"                    table\u003dbuild_requests,"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_b6f5cacc","line":32,"in_reply_to":"9a061dce_93dc1848","updated":"2016-04-08 16:22:05.000000000","message":"The request_spec will no longer be used. There\u0027s nothing in it that\u0027s needed that isn\u0027t also in the instance object we\u0027ll have.","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"df0525842fb3023a15c613b2c67decc07c5caed6","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    columns_to_add \u003d ["},{"line_number":40,"context_line":"            (\u0027instance_uuid\u0027,"},{"line_number":41,"context_line":"                Column(\u0027instance_uuid\u0027, String(length\u003d36))),"},{"line_number":42,"context_line":"            (\u0027instance\u0027,"},{"line_number":43,"context_line":"                Column(\u0027instance\u0027, Text())),"},{"line_number":44,"context_line":"    ]"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_f3ed94f0","line":41,"updated":"2016-04-08 15:59:01.000000000","message":"nullable or not?","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"668a1058e3f8e7487003fd1a8adb3abcef36d818","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"    columns_to_add \u003d ["},{"line_number":40,"context_line":"            (\u0027instance_uuid\u0027,"},{"line_number":41,"context_line":"                Column(\u0027instance_uuid\u0027, String(length\u003d36))),"},{"line_number":42,"context_line":"            (\u0027instance\u0027,"},{"line_number":43,"context_line":"                Column(\u0027instance\u0027, Text())),"},{"line_number":44,"context_line":"    ]"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_76a33250","line":41,"in_reply_to":"9a061dce_f3ed94f0","updated":"2016-04-08 16:22:05.000000000","message":"I would like it not be nullable but some db engine complained about that, maybe sqlite? Because the column isn\u0027t populated yet it can\u0027t be made nullable. Although I hadn\u0027t considered doing it in two steps until just now, so I\u0027ll try that.","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"df0525842fb3023a15c613b2c67decc07c5caed6","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                build_requests.c.instance_uuid)"},{"line_number":55,"context_line":"        index.create()"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    columns_to_nullify \u003d [\u0027request_spec_id\u0027, \u0027user_id\u0027, \u0027security_groups\u0027,"},{"line_number":58,"context_line":"            \u0027config_drive\u0027]"},{"line_number":59,"context_line":"    for column in columns_to_nullify:"},{"line_number":60,"context_line":"        getattr(build_requests.c, column).alter(nullable\u003dTrue)"},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_3308ac91","line":58,"range":{"start_line":57,"start_character":56,"end_line":58,"end_character":27},"updated":"2016-04-08 15:59:01.000000000","message":"If we get these from the instance why don\u0027t we drop the columns?","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"498477d9c670761b07db1d4fbeab257aa2b6df29","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                build_requests.c.instance_uuid)"},{"line_number":55,"context_line":"        index.create()"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    columns_to_nullify \u003d [\u0027request_spec_id\u0027, \u0027user_id\u0027, \u0027security_groups\u0027,"},{"line_number":58,"context_line":"            \u0027config_drive\u0027]"},{"line_number":59,"context_line":"    for column in columns_to_nullify:"},{"line_number":60,"context_line":"        getattr(build_requests.c, column).alter(nullable\u003dTrue)"},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_d6531e6b","line":58,"range":{"start_line":57,"start_character":56,"end_line":58,"end_character":27},"in_reply_to":"9a061dce_3308ac91","updated":"2016-04-08 16:18:02.000000000","message":"OK we can\u0027t drop them because of the deprecation period...maybe add a comment about that?","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"668a1058e3f8e7487003fd1a8adb3abcef36d818","unresolved":false,"context_lines":[{"line_number":54,"context_line":"                build_requests.c.instance_uuid)"},{"line_number":55,"context_line":"        index.create()"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    columns_to_nullify \u003d [\u0027request_spec_id\u0027, \u0027user_id\u0027, \u0027security_groups\u0027,"},{"line_number":58,"context_line":"            \u0027config_drive\u0027]"},{"line_number":59,"context_line":"    for column in columns_to_nullify:"},{"line_number":60,"context_line":"        getattr(build_requests.c, column).alter(nullable\u003dTrue)"},{"line_number":61,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_194b075b","line":58,"range":{"start_line":57,"start_character":56,"end_line":58,"end_character":27},"in_reply_to":"9a061dce_d6531e6b","updated":"2016-04-08 16:22:05.000000000","message":"Sure.","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"}],"nova/db/sqlalchemy/api_models.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a3b902d6d183eabb99d7d6ce617b8d396cf4224a","unresolved":false,"context_lines":[{"line_number":170,"context_line":"    instance_uuid \u003d Column(String(36))"},{"line_number":171,"context_line":"    project_id \u003d Column(String(255), nullable\u003dFalse)"},{"line_number":172,"context_line":"    instance \u003d Column(Text)"},{"line_number":173,"context_line":"    # TODO(alaski): Drop these from the db"},{"line_number":174,"context_line":"    # request_spec_id \u003d Column(Integer, ForeignKey(\u0027request_specs.id\u0027),"},{"line_number":175,"context_line":"    #                     nullable\u003dFalse)"},{"line_number":176,"context_line":"    # user_id \u003d Column(String(255), nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a18252c_7581888f","line":173,"updated":"2016-04-11 21:24:15.000000000","message":"Normally I would say I really hate having commented-out code like this. Any reason not to just replace the block below with a list of columns to drop?","commit_id":"f28f57403b74cddbbba72bcd9ee2cb9f747e4140"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"31d1e136c6fc5cdf0519d12135c928e8dbcca8e1","unresolved":false,"context_lines":[{"line_number":170,"context_line":"    instance_uuid \u003d Column(String(36))"},{"line_number":171,"context_line":"    project_id \u003d Column(String(255), nullable\u003dFalse)"},{"line_number":172,"context_line":"    instance \u003d Column(Text)"},{"line_number":173,"context_line":"    # TODO(alaski): Drop these from the db"},{"line_number":174,"context_line":"    # request_spec_id \u003d Column(Integer, ForeignKey(\u0027request_specs.id\u0027),"},{"line_number":175,"context_line":"    #                     nullable\u003dFalse)"},{"line_number":176,"context_line":"    # user_id \u003d Column(String(255), nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a18252c_9fe89f7e","line":173,"in_reply_to":"5a18252c_7581888f","updated":"2016-04-12 13:54:57.000000000","message":"Sure, I can do that. I just left it in case anyone might be curious about what the columns actually contain.","commit_id":"f28f57403b74cddbbba72bcd9ee2cb9f747e4140"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"498477d9c670761b07db1d4fbeab257aa2b6df29","unresolved":false,"context_lines":[{"line_number":170,"context_line":"    instance_uuid \u003d Column(String(36))"},{"line_number":171,"context_line":"    project_id \u003d Column(String(255), nullable\u003dFalse)"},{"line_number":172,"context_line":"    instance \u003d Column(Text)"},{"line_number":173,"context_line":"    # TODO(alaski): Drop these from the db"},{"line_number":174,"context_line":"    # request_spec_id \u003d Column(Integer, ForeignKey(\u0027request_specs.id\u0027),"},{"line_number":175,"context_line":"    #                     nullable\u003dFalse)"},{"line_number":176,"context_line":"    # user_id \u003d Column(String(255), nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_d66cbe38","line":173,"range":{"start_line":173,"start_character":20,"end_line":173,"end_character":42},"updated":"2016-04-08 16:18:02.000000000","message":"in Ocata so we are sure.","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"668a1058e3f8e7487003fd1a8adb3abcef36d818","unresolved":false,"context_lines":[{"line_number":170,"context_line":"    instance_uuid \u003d Column(String(36))"},{"line_number":171,"context_line":"    project_id \u003d Column(String(255), nullable\u003dFalse)"},{"line_number":172,"context_line":"    instance \u003d Column(Text)"},{"line_number":173,"context_line":"    # TODO(alaski): Drop these from the db"},{"line_number":174,"context_line":"    # request_spec_id \u003d Column(Integer, ForeignKey(\u0027request_specs.id\u0027),"},{"line_number":175,"context_line":"    #                     nullable\u003dFalse)"},{"line_number":176,"context_line":"    # user_id \u003d Column(String(255), nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":8,"id":"9a061dce_5649ce8d","line":173,"range":{"start_line":173,"start_character":20,"end_line":173,"end_character":42},"in_reply_to":"9a061dce_d66cbe38","updated":"2016-04-08 16:22:05.000000000","message":"Can do.","commit_id":"a9614ed3de8d77f27f19bbd1e881877345037359"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ab158ab79624cc888772ac4097841e28a50cc0f4","unresolved":false,"context_lines":[{"line_number":170,"context_line":"    instance_uuid \u003d Column(String(36))"},{"line_number":171,"context_line":"    project_id \u003d Column(String(255), nullable\u003dFalse)"},{"line_number":172,"context_line":"    instance \u003d Column(Text)"},{"line_number":173,"context_line":"    # TODO(alaski): Drop these from the db in Ocata"},{"line_number":174,"context_line":"    # request_spec_id \u003d Column(Integer, ForeignKey(\u0027request_specs.id\u0027),"},{"line_number":175,"context_line":"    #                     nullable\u003dFalse)"},{"line_number":176,"context_line":"    # user_id \u003d Column(String(255), nullable\u003dFalse)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a18252c_f8a46d09","line":173,"updated":"2016-04-11 21:26:31.000000000","message":"Same comment as before.","commit_id":"1f04beb031e566186c40174439f69df64ccd5d86"}],"nova/objects/build_request.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a3b902d6d183eabb99d7d6ce617b8d396cf4224a","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _load_instance(self, db_instance):"},{"line_number":48,"context_line":"        self.instance \u003d objects.Instance.obj_from_primitive("},{"line_number":49,"context_line":"                jsonutils.loads(db_instance))"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    @staticmethod"},{"line_number":52,"context_line":"    def _from_db_object(context, req, db_req):"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a18252c_d87251ad","line":49,"updated":"2016-04-11 21:24:15.000000000","message":"So, this could explode if someone writes a newer instance object into the DB than we support. We should probably be careful about service versions when writing these right? More careful with instance because it changes a lot...","commit_id":"f28f57403b74cddbbba72bcd9ee2cb9f747e4140"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"31d1e136c6fc5cdf0519d12135c928e8dbcca8e1","unresolved":false,"context_lines":[{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def _load_instance(self, db_instance):"},{"line_number":48,"context_line":"        self.instance \u003d objects.Instance.obj_from_primitive("},{"line_number":49,"context_line":"                jsonutils.loads(db_instance))"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"    @staticmethod"},{"line_number":52,"context_line":"    def _from_db_object(context, req, db_req):"}],"source_content_type":"text/x-python","patch_set":7,"id":"5a18252c_5f63a71a","line":49,"in_reply_to":"5a18252c_d87251ad","updated":"2016-04-12 13:54:57.000000000","message":"I\u0027ll look into what that entails, but we should take some care to not write a record that can\u0027t be read later.","commit_id":"f28f57403b74cddbbba72bcd9ee2cb9f747e4140"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"ab158ab79624cc888772ac4097841e28a50cc0f4","unresolved":false,"context_lines":[{"line_number":98,"context_line":"        if not self.obj_attr_is_set(\u0027instance_uuid\u0027):"},{"line_number":99,"context_line":"            # We can\u0027t guarantee this is not null in the db so check here"},{"line_number":100,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":101,"context_line":"                    reason\u003d\u0027instance_uuid must be set\u0027)"},{"line_number":102,"context_line":""},{"line_number":103,"context_line":"        updates \u003d self._get_update_primitives()"},{"line_number":104,"context_line":"        db_req \u003d self._create_in_db(self._context, updates)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5a18252c_3896e594","line":101,"updated":"2016-04-11 21:26:31.000000000","message":"I said this in an old patch, but if we serialize a new instance into the DB here and an older node tries to deserialize, it will \u0027splode. Think we should respect some service_version action here or just play wild west?","commit_id":"1f04beb031e566186c40174439f69df64ccd5d86"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"c71c90effa68b9876a7de067bcd9a30ffa26f711","unresolved":false,"context_lines":[{"line_number":37,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":38,"context_line":"class BuildRequest(base.NovaObject):"},{"line_number":39,"context_line":"    # Version 1.0: Initial version"},{"line_number":40,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    fields \u003d {"},{"line_number":43,"context_line":"        \u0027id\u0027: fields.IntegerField(),"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_cb1d4b68","line":40,"updated":"2016-04-15 15:12:49.000000000","message":"shouldn\u0027t we bump the version and provide a backwards compat path ?","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"203e8bca18117f527936b8512bca8e0f01db4fc1","unresolved":false,"context_lines":[{"line_number":37,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":38,"context_line":"class BuildRequest(base.NovaObject):"},{"line_number":39,"context_line":"    # Version 1.0: Initial version"},{"line_number":40,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    fields \u003d {"},{"line_number":43,"context_line":"        \u0027id\u0027: fields.IntegerField(),"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_fa2bab31","line":40,"in_reply_to":"1a122d0e_4e12e963","updated":"2016-04-15 17:16:45.000000000","message":"I think it was discussed quite a bit earlier in the review comments (or was it the previous patch?) Either way, comments on the review are fine for this instead of comments in the code, IMHO. Since the point is the history doesn\u0027t matter, I don\u0027t think we need them in code.","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"a7f78dee149a125d185d9c941b71d0fba37f6225","unresolved":false,"context_lines":[{"line_number":37,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":38,"context_line":"class BuildRequest(base.NovaObject):"},{"line_number":39,"context_line":"    # Version 1.0: Initial version"},{"line_number":40,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    fields \u003d {"},{"line_number":43,"context_line":"        \u0027id\u0027: fields.IntegerField(),"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_6e99a06e","line":40,"in_reply_to":"1a122d0e_4e12e963","updated":"2016-04-15 17:25:23.000000000","message":"I\u0027ll add it to the commit message.","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"55e58e1ef14bedc822945272b186c6dc31718a55","unresolved":false,"context_lines":[{"line_number":37,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":38,"context_line":"class BuildRequest(base.NovaObject):"},{"line_number":39,"context_line":"    # Version 1.0: Initial version"},{"line_number":40,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    fields \u003d {"},{"line_number":43,"context_line":"        \u0027id\u0027: fields.IntegerField(),"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_4e12e963","line":40,"in_reply_to":"1a122d0e_6bcb5773","updated":"2016-04-15 15:46:51.000000000","message":"I thought about that when commenting that. That said, I\u0027m wondering if we should then comment that given the pattern we usually use.","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"376997668c1d9e0ea2b6fe0be3fcc0e5a0feda3b","unresolved":false,"context_lines":[{"line_number":37,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":38,"context_line":"class BuildRequest(base.NovaObject):"},{"line_number":39,"context_line":"    # Version 1.0: Initial version"},{"line_number":40,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    fields \u003d {"},{"line_number":43,"context_line":"        \u0027id\u0027: fields.IntegerField(),"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_dc9326a2","line":40,"in_reply_to":"1a122d0e_6e99a06e","updated":"2016-04-18 08:05:54.000000000","message":"Ack, I missed that in the earlier PSes.","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"cb7cda2a21ecf574c8ca467980c8d2776e1934d9","unresolved":false,"context_lines":[{"line_number":37,"context_line":"@base.NovaObjectRegistry.register"},{"line_number":38,"context_line":"class BuildRequest(base.NovaObject):"},{"line_number":39,"context_line":"    # Version 1.0: Initial version"},{"line_number":40,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"    fields \u003d {"},{"line_number":43,"context_line":"        \u0027id\u0027: fields.IntegerField(),"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_6bcb5773","line":40,"in_reply_to":"1a122d0e_cb1d4b68","updated":"2016-04-15 15:19:12.000000000","message":"Generally yes. In this case BuildRequest is not going over RPC, and not being looked up anywhere yet. So it\u0027s safe to update it without a bump.","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"203e8bca18117f527936b8512bca8e0f01db4fc1","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        # NOTE(alaski): Be very careful with instance loading because it"},{"line_number":85,"context_line":"        # changes more than most objects."},{"line_number":86,"context_line":"        try:"},{"line_number":87,"context_line":"            self.instance \u003d objects.Instance.obj_from_primitive("},{"line_number":88,"context_line":"                    jsonutils.loads(db_instance))"},{"line_number":89,"context_line":"        except ovoo_exc.IncompatibleObjectVersion:"},{"line_number":90,"context_line":"            # This should only happen if proper service upgrade strategies are"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_0ebbccc5","line":87,"updated":"2016-04-15 17:16:45.000000000","message":"This could be None since the column is nullable. I think we should take extra care to catch that case and raise something useful with reasonable logs so it\u0027s easy to figure out.","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"a7f78dee149a125d185d9c941b71d0fba37f6225","unresolved":false,"context_lines":[{"line_number":86,"context_line":"        try:"},{"line_number":87,"context_line":"            self.instance \u003d objects.Instance.obj_from_primitive("},{"line_number":88,"context_line":"                    jsonutils.loads(db_instance))"},{"line_number":89,"context_line":"        except ovoo_exc.IncompatibleObjectVersion:"},{"line_number":90,"context_line":"            # This should only happen if proper service upgrade strategies are"},{"line_number":91,"context_line":"            # not followed. Log the exception and reraise. This should be"},{"line_number":92,"context_line":"            # caught and handled in the API."}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_aef8d87d","line":89,"updated":"2016-04-15 17:25:23.000000000","message":"I\u0027m going to catch and log the exception if db_instance happens to be None. Then raise something that the API can catch and present nicely.","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"203e8bca18117f527936b8512bca8e0f01db4fc1","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            # caught and handled in the API."},{"line_number":93,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":94,"context_line":"                LOG.exception(_LE(\u0027Could not deserialize instance in \u0027"},{"line_number":95,"context_line":"                                  \u0027BuildRequest\u0027))"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    @staticmethod"},{"line_number":98,"context_line":"    def _from_db_object(context, req, db_req):"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_bac81376","line":95,"updated":"2016-04-15 17:16:45.000000000","message":"I think I would probably say we should dump more information out of this at debug level, like the version we found, and maybe some details about the request so we know which one.","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"a7f78dee149a125d185d9c941b71d0fba37f6225","unresolved":false,"context_lines":[{"line_number":92,"context_line":"            # caught and handled in the API."},{"line_number":93,"context_line":"            with excutils.save_and_reraise_exception():"},{"line_number":94,"context_line":"                LOG.exception(_LE(\u0027Could not deserialize instance in \u0027"},{"line_number":95,"context_line":"                                  \u0027BuildRequest\u0027))"},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"    @staticmethod"},{"line_number":98,"context_line":"    def _from_db_object(context, req, db_req):"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_8e6a3c19","line":95,"in_reply_to":"1a122d0e_bac81376","updated":"2016-04-15 17:25:23.000000000","message":"Can do.","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"87547d31a84cc2d82bf63bebfa4dd5514b9533e3","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        \u0027task_state\u0027: fields.StringField(nullable\u003dTrue),"},{"line_number":51,"context_line":"        \u0027image_ref\u0027: fields.StringField(nullable\u003dTrue),"},{"line_number":52,"context_line":"        \u0027access_ip_v4\u0027: fields.IPV4AddressField(nullable\u003dTrue),"},{"line_number":53,"context_line":"        \u0027access_ip_v6\u0027: fields.IPV6AddressField(nullable\u003dTrue),"},{"line_number":54,"context_line":"        \u0027info_cache\u0027: fields.ObjectField(\u0027InstanceInfoCache\u0027, nullable\u003dTrue),"},{"line_number":55,"context_line":"        \u0027security_groups\u0027: fields.ObjectField(\u0027SecurityGroupList\u0027),"},{"line_number":56,"context_line":"        \u0027config_drive\u0027: fields.BooleanField(default\u003dFalse),"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_672f7e88","line":53,"updated":"2016-04-19 21:34:18.000000000","message":"All these type of fields above, like access_ip_v4, also worry me. They are a vestigial tail from the days of nova-network when a VM only had a single vNIC. Nowadays, Neutron allows much more flexibility in the ability to specify multiple vNICs, multiple ports -- soon with or without fixed IP addresses. Having these type of fields pulled into the BuildRequest object troubles me but I don\u0027t have a good alternative right this moment. :(","commit_id":"e26930ad79441736d9a4a62d8f943558471d2dbc"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"0e8712d98f213d79b96c65323d923e9741ae9e77","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        \u0027task_state\u0027: fields.StringField(nullable\u003dTrue),"},{"line_number":51,"context_line":"        \u0027image_ref\u0027: fields.StringField(nullable\u003dTrue),"},{"line_number":52,"context_line":"        \u0027access_ip_v4\u0027: fields.IPV4AddressField(nullable\u003dTrue),"},{"line_number":53,"context_line":"        \u0027access_ip_v6\u0027: fields.IPV6AddressField(nullable\u003dTrue),"},{"line_number":54,"context_line":"        \u0027info_cache\u0027: fields.ObjectField(\u0027InstanceInfoCache\u0027, nullable\u003dTrue),"},{"line_number":55,"context_line":"        \u0027security_groups\u0027: fields.ObjectField(\u0027SecurityGroupList\u0027),"},{"line_number":56,"context_line":"        \u0027config_drive\u0027: fields.BooleanField(default\u003dFalse),"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_9ee0f4ce","line":53,"in_reply_to":"1a122d0e_672f7e88","updated":"2016-04-20 15:17:41.000000000","message":"These fields are getting dropped a few patches up the stack. The reason for adding \u0027instance\u0027 here is so that they can be dropped. This means that as instance is updated to remove some of these vestigial things those changes will propagate to here.","commit_id":"e26930ad79441736d9a4a62d8f943558471d2dbc"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"87547d31a84cc2d82bf63bebfa4dd5514b9533e3","unresolved":false,"context_lines":[{"line_number":128,"context_line":"    def _get_by_instance_uuid_from_db(context, instance_uuid):"},{"line_number":129,"context_line":"        db_req \u003d (context.session.query(api_models.BuildRequest)"},{"line_number":130,"context_line":"                .options(joinedload(\u0027request_spec\u0027))"},{"line_number":131,"context_line":"                .filter_by(instance_uuid\u003dinstance_uuid)).first()"},{"line_number":132,"context_line":"        if not db_req:"},{"line_number":133,"context_line":"            raise exception.BuildRequestNotFound(uuid\u003dinstance_uuid)"},{"line_number":134,"context_line":"        return db_req"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_c74e526e","line":131,"updated":"2016-04-19 21:34:18.000000000","message":"Where is the DB content for the db_instance parameter from the newly-added _load_instance() going to come from? Is there a relation to some instances table in the API database that I don\u0027t know about?","commit_id":"e26930ad79441736d9a4a62d8f943558471d2dbc"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"0e8712d98f213d79b96c65323d923e9741ae9e77","unresolved":false,"context_lines":[{"line_number":128,"context_line":"    def _get_by_instance_uuid_from_db(context, instance_uuid):"},{"line_number":129,"context_line":"        db_req \u003d (context.session.query(api_models.BuildRequest)"},{"line_number":130,"context_line":"                .options(joinedload(\u0027request_spec\u0027))"},{"line_number":131,"context_line":"                .filter_by(instance_uuid\u003dinstance_uuid)).first()"},{"line_number":132,"context_line":"        if not db_req:"},{"line_number":133,"context_line":"            raise exception.BuildRequestNotFound(uuid\u003dinstance_uuid)"},{"line_number":134,"context_line":"        return db_req"}],"source_content_type":"text/x-python","patch_set":15,"id":"1a122d0e_5934b6dc","line":131,"in_reply_to":"1a122d0e_c74e526e","updated":"2016-04-20 15:17:41.000000000","message":"No relationship, a serialized instance object is just being stored in the build_requests table. https://review.openstack.org/#/c/306023/1/nova/db/sqlalchemy/api_models.py.\n\nUltimately BuildRequest is just sort of a pre-instance that exists before the instance has been scheduled and created within a cell. I originally went the route of trying to store the instance components necessary for doing that, but it turns out that almost all of instance is needed. So for now just stashing an serialized, but not persisted, instance object makes sense.\n\nThere is a lot of cleanup that could eventually be done but it\u0027s somewhat orthogonal to the cells effort so I\u0027m punting on doing that here.","commit_id":"e26930ad79441736d9a4a62d8f943558471d2dbc"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0b25b537f0ab21365f3a6590351b9d6f9bade0be","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        if not self.obj_attr_is_set(\u0027instance_uuid\u0027):"},{"line_number":175,"context_line":"            # We can\u0027t guarantee this is not null in the db so check here"},{"line_number":176,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":177,"context_line":"                    reason\u003d\u0027instance_uuid must be set\u0027)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        updates \u003d self._get_update_primitives()"},{"line_number":180,"context_line":"        db_req \u003d self._create_in_db(self._context, updates)"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_ac1a6015","line":177,"updated":"2016-04-23 12:40:53.000000000","message":"Where is BuildRequest.instance field being saved to the DB?","commit_id":"a5d3b57c3d4fb785c5f5eebf2559e495595a6b34"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"75d27478d7ec10335dc25b9962b6cd615b4621be","unresolved":false,"context_lines":[{"line_number":174,"context_line":"        if not self.obj_attr_is_set(\u0027instance_uuid\u0027):"},{"line_number":175,"context_line":"            # We can\u0027t guarantee this is not null in the db so check here"},{"line_number":176,"context_line":"            raise exception.ObjectActionError(action\u003d\u0027create\u0027,"},{"line_number":177,"context_line":"                    reason\u003d\u0027instance_uuid must be set\u0027)"},{"line_number":178,"context_line":""},{"line_number":179,"context_line":"        updates \u003d self._get_update_primitives()"},{"line_number":180,"context_line":"        db_req \u003d self._create_in_db(self._context, updates)"}],"source_content_type":"text/x-python","patch_set":16,"id":"1a122d0e_a63b82ea","line":177,"in_reply_to":"1a122d0e_ac1a6015","updated":"2016-04-25 15:24:43.000000000","message":"Mmm,good catch, we\u0027re just directly creating a new object but I can\u0027t see where that field is set unless by reading something from the DB, which is not what we\u0027re doing in https://github.com/openstack/nova/blob/a6425fa3040e1b92e632b4b056fdb96ed52bfa8d/nova/compute/api.py#L976","commit_id":"a5d3b57c3d4fb785c5f5eebf2559e495595a6b34"}],"nova/tests/unit/compute/test_compute_api.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"203e8bca18117f527936b8512bca8e0f01db4fc1","unresolved":false,"context_lines":[{"line_number":3050,"context_line":""},{"line_number":3051,"context_line":"    def test_provision_instances_creates_destroys_build_request(self):"},{"line_number":3052,"context_line":"        @mock.patch.object(self.compute_api, \u0027_check_num_instances_quota\u0027)"},{"line_number":3053,"context_line":"        @mock.patch.object(objects, \u0027Instance\u0027)"},{"line_number":3054,"context_line":"        @mock.patch.object(self.compute_api.security_group_api,"},{"line_number":3055,"context_line":"                \u0027ensure_default\u0027)"},{"line_number":3056,"context_line":"        @mock.patch.object(self.compute_api, \u0027_validate_bdm\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_ba2013f9","line":3053,"updated":"2016-04-15 17:16:45.000000000","message":"Hmm, this might be a little extreme. If anything uses a reference directly to the module, they won\u0027t get the mocked instance at that point. Meaning:\n\n  from nova.objects import instance as instance_obj\n  ...\n  inst \u003d instance_obj.Instance() # Not the mocked one!","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"a7f78dee149a125d185d9c941b71d0fba37f6225","unresolved":false,"context_lines":[{"line_number":3050,"context_line":""},{"line_number":3051,"context_line":"    def test_provision_instances_creates_destroys_build_request(self):"},{"line_number":3052,"context_line":"        @mock.patch.object(self.compute_api, \u0027_check_num_instances_quota\u0027)"},{"line_number":3053,"context_line":"        @mock.patch.object(objects, \u0027Instance\u0027)"},{"line_number":3054,"context_line":"        @mock.patch.object(self.compute_api.security_group_api,"},{"line_number":3055,"context_line":"                \u0027ensure_default\u0027)"},{"line_number":3056,"context_line":"        @mock.patch.object(self.compute_api, \u0027_validate_bdm\u0027)"}],"source_content_type":"text/x-python","patch_set":14,"id":"1a122d0e_d11a156e","line":3053,"in_reply_to":"1a122d0e_ba2013f9","updated":"2016-04-15 17:25:23.000000000","message":"Discussed this in irc briefly. I think this is the right thing to do because I do want to use the mock  on objects.Instance. If the code is changed to bypass that and import instance directly this test will fail and would need to be updated.\n\nAnd I think we said doing that is a no-no because it bypasses versioning or the registry or something like that.","commit_id":"eda6249923f7ce84da96176506a64897d4d2b4a3"}]}
