)]}'
{"nova/scheduler/filters/availability_zone_filter.py":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"674cd816556846e81b490b9d655db941ebc3d7c6","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        # NOTE(chaochin): instance AZ may not be consistent with its host AZ."},{"line_number":46,"context_line":"        # Need to use host AZ, if instance has reached a host."},{"line_number":47,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":48,"context_line":"        az \u003d avail_zone.get_instance_availability_zone(ctxt, props)"},{"line_number":49,"context_line":"        availability_zone \u003d az or props.get(\u0027availability_zone\u0027)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        if not availability_zone:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_a82a4d8e","line":48,"updated":"2015-07-22 16:31:54.000000000","message":"I\u0027m still strongly disagreeing with that as explained in https://review.openstack.org/#/c/174269/4/nova/scheduler/utils.py,cm \n\nFrom my perspective, until we get rid of instance.AZ, we need to fix it by making it correct (see https://review.openstack.org/#/c/172906/)\n\nOnce that done, and once the RequestSpec object BP is done, it would then be clear that expressing an AZ in a RequestSpec would be something from the user so we could match it against the related host AZ.","commit_id":"f2e730086a64702da5320ec16ecd55de586075b3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0041fa2ed6cf8fcd2204e75594d7bc862019e21b","unresolved":false,"context_lines":[{"line_number":45,"context_line":"        # NOTE(chaochin): instance AZ may not be consistent with its host AZ."},{"line_number":46,"context_line":"        # Need to use host AZ, if instance has reached a host."},{"line_number":47,"context_line":"        ctxt \u003d context.get_admin_context()"},{"line_number":48,"context_line":"        az \u003d avail_zone.get_instance_availability_zone(ctxt, props)"},{"line_number":49,"context_line":"        availability_zone \u003d az or props.get(\u0027availability_zone\u0027)"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"        if not availability_zone:"}],"source_content_type":"text/x-python","patch_set":7,"id":"3a50d1a3_b704e449","line":48,"in_reply_to":"3a50d1a3_a82a4d8e","updated":"2015-07-22 18:28:06.000000000","message":"This is a bug going back a long ways - are there no tactical workaround fixes that we can land and backport before the RequestSpec stuff since that\u0027s not something we can backport to stable branches to fix this bug.","commit_id":"f2e730086a64702da5320ec16ecd55de586075b3"}],"nova/scheduler/utils.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3e97356446ab19d0091dc9428e839caf1c6c282e","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    # Need to use host AZ in request_spec, in order to ensure scheduler select"},{"line_number":80,"context_line":"    # the right hosts."},{"line_number":81,"context_line":"    if instance.get(\u0027host\u0027):"},{"line_number":82,"context_line":"        az \u003d avail_zone.get_instance_availability_zone(ctxt, instance)"},{"line_number":83,"context_line":"        request_spec[\u0027instance_properties\u0027][\u0027availability_zone\u0027] \u003d az"},{"line_number":84,"context_line":"    return jsonutils.to_primitive(request_spec)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_e41e0f6f","line":82,"updated":"2015-05-20 16:19:43.000000000","message":"Might be interesting / useful to log (debug level) if the instance.availability_zone !\u003d az after this to show that we\u0027re using the host aggregate az.","commit_id":"dd82e1d7305df1cb47011ac1b9738ab76226b425"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d34ec7d5af6880c486e89e0c4a682707317e9807","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    # Need to use host AZ in request_spec, in order to ensure scheduler select"},{"line_number":80,"context_line":"    # the right hosts."},{"line_number":81,"context_line":"    if instance.get(\u0027host\u0027):"},{"line_number":82,"context_line":"        az \u003d avail_zone.get_instance_availability_zone(ctxt, instance)"},{"line_number":83,"context_line":"        request_spec[\u0027instance_properties\u0027][\u0027availability_zone\u0027] \u003d az"},{"line_number":84,"context_line":"    return jsonutils.to_primitive(request_spec)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_82026f3d","line":82,"in_reply_to":"7a016987_64dfa63a","updated":"2015-06-13 13:17:33.000000000","message":"Sylvain, there are a few changes related to AZ\u0027s up for review right now, do you know if any are related to the bug that this is trying to fix (or could fix it inadvertently)?","commit_id":"dd82e1d7305df1cb47011ac1b9738ab76226b425"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"5aae869439f41dbdfef809929b3f94da0e05670f","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    # Need to use host AZ in request_spec, in order to ensure scheduler select"},{"line_number":80,"context_line":"    # the right hosts."},{"line_number":81,"context_line":"    if instance.get(\u0027host\u0027):"},{"line_number":82,"context_line":"        az \u003d avail_zone.get_instance_availability_zone(ctxt, instance)"},{"line_number":83,"context_line":"        request_spec[\u0027instance_properties\u0027][\u0027availability_zone\u0027] \u003d az"},{"line_number":84,"context_line":"    return jsonutils.to_primitive(request_spec)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_64dfa63a","line":82,"in_reply_to":"7a016987_e41e0f6f","updated":"2015-05-21 16:25:07.000000000","message":"I\u0027m totally against calling explicitely the AZ helper to change the instance.az value since it would either be done on the API level or just looking against the host AZ value in the filter.\n\nDoing that is just a layer isolation violation IMHO.","commit_id":"dd82e1d7305df1cb47011ac1b9738ab76226b425"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"37540ccb483c40583a769002fa45541929069f4d","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    # Need to use host AZ in request_spec, in order to ensure scheduler select"},{"line_number":80,"context_line":"    # the right hosts."},{"line_number":81,"context_line":"    if instance.get(\u0027host\u0027):"},{"line_number":82,"context_line":"        az \u003d avail_zone.get_instance_availability_zone(ctxt, instance)"},{"line_number":83,"context_line":"        request_spec[\u0027instance_properties\u0027][\u0027availability_zone\u0027] \u003d az"},{"line_number":84,"context_line":"    return jsonutils.to_primitive(request_spec)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_734dbcc3","line":82,"in_reply_to":"fa32b979_3eb2dbe5","updated":"2015-06-19 14:34:19.000000000","message":"I do not think it can be fixed in API layer. Fix it in filter should be feasible way. Since instance.AZ is buggy, we can make the code never read this value.","commit_id":"dd82e1d7305df1cb47011ac1b9738ab76226b425"},{"author":{"_account_id":8574,"name":"Qin Zhao","username":"zhaoqin","inactive":true},"change_message_id":"81f31a979609ad692845b6998ffa081b4c791862","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    # Need to use host AZ in request_spec, in order to ensure scheduler select"},{"line_number":80,"context_line":"    # the right hosts."},{"line_number":81,"context_line":"    if instance.get(\u0027host\u0027):"},{"line_number":82,"context_line":"        az \u003d avail_zone.get_instance_availability_zone(ctxt, instance)"},{"line_number":83,"context_line":"        request_spec[\u0027instance_properties\u0027][\u0027availability_zone\u0027] \u003d az"},{"line_number":84,"context_line":"    return jsonutils.to_primitive(request_spec)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_ce7a44f1","line":82,"in_reply_to":"fa32b979_62f96b4d","updated":"2015-06-17 16:25:39.000000000","message":"I feel it is related, but it does not fix my resize issue. Even if Sylvain\u0027s patch is merged, instance AZ property in db is still inconsistent with host AZ. So that the AZ in request_spec, which is consumed by AZ filter is still different from host AZ.","commit_id":"dd82e1d7305df1cb47011ac1b9738ab76226b425"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8dbde4b72328d33eea73676743cd114a5d93241d","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    # Need to use host AZ in request_spec, in order to ensure scheduler select"},{"line_number":80,"context_line":"    # the right hosts."},{"line_number":81,"context_line":"    if instance.get(\u0027host\u0027):"},{"line_number":82,"context_line":"        az \u003d avail_zone.get_instance_availability_zone(ctxt, instance)"},{"line_number":83,"context_line":"        request_spec[\u0027instance_properties\u0027][\u0027availability_zone\u0027] \u003d az"},{"line_number":84,"context_line":"    return jsonutils.to_primitive(request_spec)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_62f96b4d","line":82,"in_reply_to":"fa32b979_82026f3d","updated":"2015-06-13 13:18:45.000000000","message":"Like this? https://review.openstack.org/#/c/172906/","commit_id":"dd82e1d7305df1cb47011ac1b9738ab76226b425"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"4347d5abd5f4bf2bff16afb184b48a2d0d1648ae","unresolved":false,"context_lines":[{"line_number":79,"context_line":"    # Need to use host AZ in request_spec, in order to ensure scheduler select"},{"line_number":80,"context_line":"    # the right hosts."},{"line_number":81,"context_line":"    if instance.get(\u0027host\u0027):"},{"line_number":82,"context_line":"        az \u003d avail_zone.get_instance_availability_zone(ctxt, instance)"},{"line_number":83,"context_line":"        request_spec[\u0027instance_properties\u0027][\u0027availability_zone\u0027] \u003d az"},{"line_number":84,"context_line":"    return jsonutils.to_primitive(request_spec)"},{"line_number":85,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa32b979_3eb2dbe5","line":82,"in_reply_to":"fa32b979_ce7a44f1","updated":"2015-06-18 11:13:23.000000000","message":"MHO is that we know that instance AZ is buggy and needs to be fixed at many places. My change was just considering a race condition that was done so it was helping the instance AZ to be better synced with the host AZ by reducing the number of times it was out of sync (if you see the invalidation cache action, it\u0027s just getting it from the host AZ)\n\nAnyway, until we correctly fix all the problems we have with AZs (remember the summit session we had and how we dislike AZs), I would like to see baby steps coming in by iterating over some problems that we have.\n\nThat all said, I\u0027m definitely -2 (even if not core ;-) ) on that patch, because I think it\u0027s a layer isolation violation to just make the call here. It should be fixed at the Compute API level rather IMHO (which is why I made the fix that Matt mentioned...)","commit_id":"dd82e1d7305df1cb47011ac1b9738ab76226b425"}],"nova/tests/unit/scheduler/test_scheduler_utils.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"596a34fec8a4051c955bb2bacfac73ac663d1c21","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        self.context \u003d \u0027fake-context\u0027"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    @mock.patch(\u0027nova.objects.Flavor.get_by_flavor_id\u0027)"},{"line_number":47,"context_line":"    @mock.patch(\u0027nova.availability_zones.get_instance_availability_zone\u0027)"},{"line_number":48,"context_line":"    def test_build_request_spec_without_image(self, mock_az, mock_get):"},{"line_number":49,"context_line":"        image \u003d None"},{"line_number":50,"context_line":"        instance \u003d {\u0027uuid\u0027: \u0027fake-uuid\u0027}"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_84975b47","line":47,"updated":"2015-05-20 16:14:51.000000000","message":"There isn\u0027t a host on the instance used in this test so why would we need to mock this out since it shouldn\u0027t be called?  If anything, assert that mock_az is *not* called in this case since there is no instance.host set, right?","commit_id":"dd82e1d7305df1cb47011ac1b9738ab76226b425"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"596a34fec8a4051c955bb2bacfac73ac663d1c21","unresolved":false,"context_lines":[{"line_number":74,"context_line":"        self.assertIsInstance(request_spec[\u0027instance_properties\u0027], dict)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"    @mock.patch(\u0027nova.availability_zones.get_instance_availability_zone\u0027)"},{"line_number":77,"context_line":"    def test_build_request_spec_availability_zone(self, mock_az):"},{"line_number":78,"context_line":"        image \u003d None"},{"line_number":79,"context_line":"        instance_type \u003d objects.Flavor()"},{"line_number":80,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_c49c3310","line":77,"updated":"2015-05-20 16:14:51.000000000","message":"I would add a comment that describes this test as asserting the az is pulled from mock_az since there is a host associated with the instance already.  This is kind of the same as the test above it since the fake instance has a fake-host value.  Couldn\u0027t we just roll this up into the test above?","commit_id":"dd82e1d7305df1cb47011ac1b9738ab76226b425"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"596a34fec8a4051c955bb2bacfac73ac663d1c21","unresolved":false,"context_lines":[{"line_number":90,"context_line":"            request_spec[\u0027instance_properties\u0027][\u0027availability_zone\u0027])"},{"line_number":91,"context_line":""},{"line_number":92,"context_line":"    @mock.patch(\u0027nova.availability_zones.get_instance_availability_zone\u0027)"},{"line_number":93,"context_line":"    def test_build_request_spec_availability_zone_none_host(self, mock_az):"},{"line_number":94,"context_line":"        image \u003d None"},{"line_number":95,"context_line":"        instance_type \u003d objects.Flavor()"},{"line_number":96,"context_line":"        instance \u003d fake_instance.fake_instance_obj(self.context)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a016987_0497ebec","line":93,"updated":"2015-05-20 16:14:51.000000000","message":"I would maybe add a comment that describes this test as asserting the az is pulled from the instance since host is None.\n\nFWIW, I think you could roll this into test_build_request_spec_without_image above by just setting the instance.availability_zone since there isn\u0027t a host set.","commit_id":"dd82e1d7305df1cb47011ac1b9738ab76226b425"}]}
