)]}'
{"nova/tests/unit/virt/test_block_device.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"e919646d8b735d346a104939a8090cdf923efb5f","unresolved":false,"context_lines":[{"line_number":668,"context_line":""},{"line_number":669,"context_line":"        test_bdm.attach(self.context, instance, self.volume_api,"},{"line_number":670,"context_line":"                        self.virt_driver, wait_func)"},{"line_number":671,"context_line":"        self.assertEqual(test_bdm.volume_id, \u0027fake-volume-id-2\u0027)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"    def test_snapshot_attach_fail_volume(self):"},{"line_number":674,"context_line":"        fail_volume_snapshot \u003d self.snapshot_bdm.copy()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_3e2b7b84","line":671,"updated":"2015-09-24 21:53:50.000000000","message":"nit: Should really be the argument order (expected, actual), but I see this in existing code, and it\u0027s a minor thing, so just pointing it out.","commit_id":"e002346376fcff39a18f0b8202332701f5d11c5a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d73621a0e5c1f4eb256426a055feffbcc5619578","unresolved":false,"context_lines":[{"line_number":668,"context_line":""},{"line_number":669,"context_line":"        test_bdm.attach(self.context, instance, self.volume_api,"},{"line_number":670,"context_line":"                        self.virt_driver, wait_func)"},{"line_number":671,"context_line":"        self.assertEqual(test_bdm.volume_id, \u0027fake-volume-id-2\u0027)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"    def test_snapshot_attach_fail_volume(self):"},{"line_number":674,"context_line":"        fail_volume_snapshot \u003d self.snapshot_bdm.copy()"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_4be21c05","line":671,"in_reply_to":"9a1a9d01_3e2b7b84","updated":"2015-09-25 13:24:29.000000000","message":"Yeah this was a copy/paste, but I can update it.","commit_id":"e002346376fcff39a18f0b8202332701f5d11c5a"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"e919646d8b735d346a104939a8090cdf923efb5f","unresolved":false,"context_lines":[{"line_number":904,"context_line":"        volume \u003d {\u0027id\u0027: \u0027fake-volume-id-2\u0027,"},{"line_number":905,"context_line":"                  \u0027display_name\u0027: \u0027fake-uuid-blank-vol\u0027}"},{"line_number":906,"context_line":""},{"line_number":907,"context_line":"        with contextlib.nested("},{"line_number":908,"context_line":"            mock.patch.object(self.volume_api, \u0027create\u0027, return_value\u003dvolume),"},{"line_number":909,"context_line":"            mock.patch.object(volume_class, \u0027attach\u0027)"},{"line_number":910,"context_line":"        ) as (vol_create, vol_attach):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_9e13a75c","line":907,"updated":"2015-09-24 21:53:50.000000000","message":"context.lib is deprecated. You should be able to do nested with blocks now that we don\u0027t need to support py26.","commit_id":"e002346376fcff39a18f0b8202332701f5d11c5a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d73621a0e5c1f4eb256426a055feffbcc5619578","unresolved":false,"context_lines":[{"line_number":904,"context_line":"        volume \u003d {\u0027id\u0027: \u0027fake-volume-id-2\u0027,"},{"line_number":905,"context_line":"                  \u0027display_name\u0027: \u0027fake-uuid-blank-vol\u0027}"},{"line_number":906,"context_line":""},{"line_number":907,"context_line":"        with contextlib.nested("},{"line_number":908,"context_line":"            mock.patch.object(self.volume_api, \u0027create\u0027, return_value\u003dvolume),"},{"line_number":909,"context_line":"            mock.patch.object(volume_class, \u0027attach\u0027)"},{"line_number":910,"context_line":"        ) as (vol_create, vol_attach):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_ebe77010","line":907,"in_reply_to":"9a1a9d01_9e13a75c","updated":"2015-09-25 13:24:29.000000000","message":"Yeah, again, copy/paste.","commit_id":"e002346376fcff39a18f0b8202332701f5d11c5a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"1c9d7fcb8ea6ad0e4d7eb384825374eb8370d74a","unresolved":false,"context_lines":[{"line_number":668,"context_line":""},{"line_number":669,"context_line":"        test_bdm.attach(self.context, instance, self.volume_api,"},{"line_number":670,"context_line":"                        self.virt_driver, wait_func)"},{"line_number":671,"context_line":"        self.assertEqual(test_bdm.volume_id, \u0027fake-volume-id-2\u0027)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"    def test_snapshot_attach_fail_volume(self):"},{"line_number":674,"context_line":"        fail_volume_snapshot \u003d self.snapshot_bdm.copy()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_f522efb8","line":671,"updated":"2015-09-25 12:53:32.000000000","message":"yeah, small nit about the usual pattern but since I guess it\u0027s a copy/paste, fair enough :\n\n  self.assertEqual(expected, observed)","commit_id":"5a8b48ed23e3ad9c7f9327b8e52e7986696cac5b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"82428996dd6806efc96dbffa7908c8ca4939c60e","unresolved":false,"context_lines":[{"line_number":668,"context_line":""},{"line_number":669,"context_line":"        test_bdm.attach(self.context, instance, self.volume_api,"},{"line_number":670,"context_line":"                        self.virt_driver, wait_func)"},{"line_number":671,"context_line":"        self.assertEqual(test_bdm.volume_id, \u0027fake-volume-id-2\u0027)"},{"line_number":672,"context_line":""},{"line_number":673,"context_line":"    def test_snapshot_attach_fail_volume(self):"},{"line_number":674,"context_line":"        fail_volume_snapshot \u003d self.snapshot_bdm.copy()"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_8ba6f4bf","line":671,"in_reply_to":"9a1a9d01_f522efb8","updated":"2015-09-25 13:27:21.000000000","message":"Done","commit_id":"5a8b48ed23e3ad9c7f9327b8e52e7986696cac5b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"82428996dd6806efc96dbffa7908c8ca4939c60e","unresolved":false,"context_lines":[{"line_number":904,"context_line":"        volume \u003d {\u0027id\u0027: \u0027fake-volume-id-2\u0027,"},{"line_number":905,"context_line":"                  \u0027display_name\u0027: \u0027fake-uuid-blank-vol\u0027}"},{"line_number":906,"context_line":""},{"line_number":907,"context_line":"        with contextlib.nested("},{"line_number":908,"context_line":"            mock.patch.object(self.volume_api, \u0027create\u0027, return_value\u003dvolume),"},{"line_number":909,"context_line":"            mock.patch.object(volume_class, \u0027attach\u0027)"},{"line_number":910,"context_line":"        ) as (vol_create, vol_attach):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_4bb0dcf4","line":907,"updated":"2015-09-25 13:27:21.000000000","message":"Will remove this per ps1.","commit_id":"5a8b48ed23e3ad9c7f9327b8e52e7986696cac5b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"384a751654996220ceb7e024f55c1b37c6851ac2","unresolved":false,"context_lines":[{"line_number":654,"context_line":"        volume \u003d {\u0027id\u0027: \u0027fake-volume-id-2\u0027,"},{"line_number":655,"context_line":"                  \u0027attach_status\u0027: \u0027detached\u0027}"},{"line_number":656,"context_line":""},{"line_number":657,"context_line":"        wait_func \u003d self.mox.CreateMockAnything()"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"        self.volume_api.get_snapshot(self.context,"},{"line_number":660,"context_line":"                                     \u0027fake-snapshot-id-1\u0027).AndReturn(snapshot)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_d4a8e8dd","line":657,"updated":"2015-09-27 06:38:37.000000000","message":"could we write this in mock?","commit_id":"a0f77502e82c3f0c474dec65622e68a452ed6725"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"33959b633b822316030f54eaab300b2346f3fc73","unresolved":false,"context_lines":[{"line_number":654,"context_line":"        volume \u003d {\u0027id\u0027: \u0027fake-volume-id-2\u0027,"},{"line_number":655,"context_line":"                  \u0027attach_status\u0027: \u0027detached\u0027}"},{"line_number":656,"context_line":""},{"line_number":657,"context_line":"        wait_func \u003d self.mox.CreateMockAnything()"},{"line_number":658,"context_line":""},{"line_number":659,"context_line":"        self.volume_api.get_snapshot(self.context,"},{"line_number":660,"context_line":"                                     \u0027fake-snapshot-id-1\u0027).AndReturn(snapshot)"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_fd729648","line":657,"in_reply_to":"9a1a9d01_d4a8e8dd","updated":"2015-09-28 13:35:53.000000000","message":"This test is a copy of an existing one that relies on the helper method _test_volume_attach which is also using mox so that\u0027s why I didn\u0027t rewrite this in mock.","commit_id":"a0f77502e82c3f0c474dec65622e68a452ed6725"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"384a751654996220ceb7e024f55c1b37c6851ac2","unresolved":false,"context_lines":[{"line_number":749,"context_line":""},{"line_number":750,"context_line":"        test_bdm.attach(self.context, instance, self.volume_api,"},{"line_number":751,"context_line":"                        self.virt_driver, wait_func)"},{"line_number":752,"context_line":"        self.assertEqual(test_bdm.volume_id, \u0027fake-volume-id-2\u0027)"},{"line_number":753,"context_line":""},{"line_number":754,"context_line":"    def test_image_attach_no_volume_cinder_cross_az_attach_false(self):"},{"line_number":755,"context_line":"        # Tests that the volume created from the image has the same AZ as the"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_f482cc51","line":752,"updated":"2015-09-27 06:38:37.000000000","message":"assertEqual should check the expected value first. please at least be consistent with the change you have above","commit_id":"a0f77502e82c3f0c474dec65622e68a452ed6725"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"33959b633b822316030f54eaab300b2346f3fc73","unresolved":false,"context_lines":[{"line_number":749,"context_line":""},{"line_number":750,"context_line":"        test_bdm.attach(self.context, instance, self.volume_api,"},{"line_number":751,"context_line":"                        self.virt_driver, wait_func)"},{"line_number":752,"context_line":"        self.assertEqual(test_bdm.volume_id, \u0027fake-volume-id-2\u0027)"},{"line_number":753,"context_line":""},{"line_number":754,"context_line":"    def test_image_attach_no_volume_cinder_cross_az_attach_false(self):"},{"line_number":755,"context_line":"        # Tests that the volume created from the image has the same AZ as the"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_9d903a45","line":752,"in_reply_to":"9a1a9d01_f482cc51","updated":"2015-09-28 13:35:53.000000000","message":"Done","commit_id":"a0f77502e82c3f0c474dec65622e68a452ed6725"}],"nova/virt/block_device.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"e919646d8b735d346a104939a8090cdf923efb5f","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    # specify the AZ when creating the volume and that AZ is not in Cinder, we"},{"line_number":85,"context_line":"    # could fail the boot from volume request early with a 400 rather than"},{"line_number":86,"context_line":"    # fail to build the instance on the compute node which results in a"},{"line_number":87,"context_line":"    # NoValidHost error."},{"line_number":88,"context_line":"    return instance.availability_zone"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_9e3ac7cc","line":87,"updated":"2015-09-24 21:53:50.000000000","message":"3 lines of code and 13 lines of comments. I like it! :)","commit_id":"e002346376fcff39a18f0b8202332701f5d11c5a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"d73621a0e5c1f4eb256426a055feffbcc5619578","unresolved":false,"context_lines":[{"line_number":84,"context_line":"    # specify the AZ when creating the volume and that AZ is not in Cinder, we"},{"line_number":85,"context_line":"    # could fail the boot from volume request early with a 400 rather than"},{"line_number":86,"context_line":"    # fail to build the instance on the compute node which results in a"},{"line_number":87,"context_line":"    # NoValidHost error."},{"line_number":88,"context_line":"    return instance.availability_zone"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a1a9d01_8bbfd4cf","line":87,"in_reply_to":"9a1a9d01_9e3ac7cc","updated":"2015-09-25 13:24:29.000000000","message":"Yeah, could have been one line with a ternary copied 3 times in each method below, but I wanted to try and make this clear since it\u0027s taken almost 2 days of talking about this to get here.","commit_id":"e002346376fcff39a18f0b8202332701f5d11c5a"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"1c9d7fcb8ea6ad0e4d7eb384825374eb8370d74a","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    return wrapped"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"def _get_volume_create_az_value(instance):"},{"line_number":64,"context_line":"    \"\"\"Determine az to use when creating a volume"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    Uses the cinder.cross_az_attach config option to determine the availability"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_754fbf92","line":63,"updated":"2015-09-25 12:53:32.000000000","message":"not sure it\u0027s really useful to create an helper method for that, but since you provided a big fat comment explaining why, I understand why you wrote it ;-)","commit_id":"5a8b48ed23e3ad9c7f9327b8e52e7986696cac5b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"82428996dd6806efc96dbffa7908c8ca4939c60e","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    return wrapped"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"def _get_volume_create_az_value(instance):"},{"line_number":64,"context_line":"    \"\"\"Determine az to use when creating a volume"},{"line_number":65,"context_line":""},{"line_number":66,"context_line":"    Uses the cinder.cross_az_attach config option to determine the availability"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_ab9f385e","line":63,"in_reply_to":"9a1a9d01_754fbf92","updated":"2015-09-25 13:27:21.000000000","message":"Yup.","commit_id":"5a8b48ed23e3ad9c7f9327b8e52e7986696cac5b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"1c9d7fcb8ea6ad0e4d7eb384825374eb8370d74a","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    # If we\u0027re allowed to attach a volume in any AZ to an instance in any AZ,"},{"line_number":74,"context_line":"    # then we don\u0027t care what AZ the volume is in so don\u0027t specify anything."},{"line_number":75,"context_line":"    if CONF.cinder.cross_az_attach:"},{"line_number":76,"context_line":"        return None"},{"line_number":77,"context_line":"    # Else the volume has to be in the same AZ as the instance otherwise we"},{"line_number":78,"context_line":"    # fail. If the AZ is not in Cinder the volume create will fail. But on the"},{"line_number":79,"context_line":"    # other hand if the volume AZ and instance AZ don\u0027t match and"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_103f71b5","line":76,"updated":"2015-09-25 12:53:32.000000000","message":"I don\u0027t see a specific test for validating that if cross_az_attach is True, then the AZ is none","commit_id":"5a8b48ed23e3ad9c7f9327b8e52e7986696cac5b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7dd71dda90ba070d3791df6c2f41131448d01242","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    # If we\u0027re allowed to attach a volume in any AZ to an instance in any AZ,"},{"line_number":74,"context_line":"    # then we don\u0027t care what AZ the volume is in so don\u0027t specify anything."},{"line_number":75,"context_line":"    if CONF.cinder.cross_az_attach:"},{"line_number":76,"context_line":"        return None"},{"line_number":77,"context_line":"    # Else the volume has to be in the same AZ as the instance otherwise we"},{"line_number":78,"context_line":"    # fail. If the AZ is not in Cinder the volume create will fail. But on the"},{"line_number":79,"context_line":"    # other hand if the volume AZ and instance AZ don\u0027t match and"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_eb545055","line":76,"in_reply_to":"9a1a9d01_0b7ae424","updated":"2015-09-25 13:32:51.000000000","message":"However, as pointed out in IRC, the existing tests in the True case don\u0027t have an AZ set on the test instance, so technically we should have a test that covers this case explicitly.  I will just add a simple unit test for that case that covers this helper method, rather than make 3 more copies of existing tests to do that.","commit_id":"5a8b48ed23e3ad9c7f9327b8e52e7986696cac5b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"82428996dd6806efc96dbffa7908c8ca4939c60e","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    # If we\u0027re allowed to attach a volume in any AZ to an instance in any AZ,"},{"line_number":74,"context_line":"    # then we don\u0027t care what AZ the volume is in so don\u0027t specify anything."},{"line_number":75,"context_line":"    if CONF.cinder.cross_az_attach:"},{"line_number":76,"context_line":"        return None"},{"line_number":77,"context_line":"    # Else the volume has to be in the same AZ as the instance otherwise we"},{"line_number":78,"context_line":"    # fail. If the AZ is not in Cinder the volume create will fail. But on the"},{"line_number":79,"context_line":"    # other hand if the volume AZ and instance AZ don\u0027t match and"}],"source_content_type":"text/x-python","patch_set":2,"id":"9a1a9d01_0b7ae424","line":76,"in_reply_to":"9a1a9d01_103f71b5","updated":"2015-09-25 13:27:21.000000000","message":"All of the existing tests hit this case, that\u0027s why I just copied the 3 for image/blank/snapshot, set the flag to False and set an AZ on the instance in those tests.","commit_id":"5a8b48ed23e3ad9c7f9327b8e52e7986696cac5b"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"384a751654996220ceb7e024f55c1b37c6851ac2","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    \"\"\""},{"line_number":73,"context_line":"    # If we\u0027re allowed to attach a volume in any AZ to an instance in any AZ,"},{"line_number":74,"context_line":"    # then we don\u0027t care what AZ the volume is in so don\u0027t specify anything."},{"line_number":75,"context_line":"    if CONF.cinder.cross_az_attach:"},{"line_number":76,"context_line":"        return None"},{"line_number":77,"context_line":"    # Else the volume has to be in the same AZ as the instance otherwise we"},{"line_number":78,"context_line":"    # fail. If the AZ is not in Cinder the volume create will fail. But on the"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_3491249a","line":75,"updated":"2015-09-27 06:38:37.000000000","message":"why not:\nreturn (None if CONF.cinder.cross_az_attach else\n        instance.availability_zone)","commit_id":"a0f77502e82c3f0c474dec65622e68a452ed6725"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c2d5d910cd6546f75c642360af6551e818c120bc","unresolved":false,"context_lines":[{"line_number":72,"context_line":"    \"\"\""},{"line_number":73,"context_line":"    # If we\u0027re allowed to attach a volume in any AZ to an instance in any AZ,"},{"line_number":74,"context_line":"    # then we don\u0027t care what AZ the volume is in so don\u0027t specify anything."},{"line_number":75,"context_line":"    if CONF.cinder.cross_az_attach:"},{"line_number":76,"context_line":"        return None"},{"line_number":77,"context_line":"    # Else the volume has to be in the same AZ as the instance otherwise we"},{"line_number":78,"context_line":"    # fail. If the AZ is not in Cinder the volume create will fail. But on the"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_1dd3ca05","line":75,"in_reply_to":"9a1a9d01_3491249a","updated":"2015-09-28 13:37:56.000000000","message":"Because my goal is clarity rather than brevity since this is a confusing use case.  That\u0027s why I have a large method with lots of comments explaining it.  I could have done this on a single line 3 times below but that\u0027d be hard to follow in a year when we have another bug related to cinder.cross_az_attach.","commit_id":"a0f77502e82c3f0c474dec65622e68a452ed6725"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"384a751654996220ceb7e024f55c1b37c6851ac2","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    # If we\u0027re allowed to attach a volume in any AZ to an instance in any AZ,"},{"line_number":74,"context_line":"    # then we don\u0027t care what AZ the volume is in so don\u0027t specify anything."},{"line_number":75,"context_line":"    if CONF.cinder.cross_az_attach:"},{"line_number":76,"context_line":"        return None"},{"line_number":77,"context_line":"    # Else the volume has to be in the same AZ as the instance otherwise we"},{"line_number":78,"context_line":"    # fail. If the AZ is not in Cinder the volume create will fail. But on the"},{"line_number":79,"context_line":"    # other hand if the volume AZ and instance AZ don\u0027t match and"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_74979c90","line":76,"updated":"2015-09-27 06:38:37.000000000","message":"by default None is returned. we do not need to explicitly return None\n\nmaybe consider having a decorator on the method that checks the config value. but that would really be an overkill","commit_id":"a0f77502e82c3f0c474dec65622e68a452ed6725"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c2d5d910cd6546f75c642360af6551e818c120bc","unresolved":false,"context_lines":[{"line_number":73,"context_line":"    # If we\u0027re allowed to attach a volume in any AZ to an instance in any AZ,"},{"line_number":74,"context_line":"    # then we don\u0027t care what AZ the volume is in so don\u0027t specify anything."},{"line_number":75,"context_line":"    if CONF.cinder.cross_az_attach:"},{"line_number":76,"context_line":"        return None"},{"line_number":77,"context_line":"    # Else the volume has to be in the same AZ as the instance otherwise we"},{"line_number":78,"context_line":"    # fail. If the AZ is not in Cinder the volume create will fail. But on the"},{"line_number":79,"context_line":"    # other hand if the volume AZ and instance AZ don\u0027t match and"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_5dff0267","line":76,"in_reply_to":"9a1a9d01_74979c90","updated":"2015-09-28 13:37:56.000000000","message":"Again, this is explicitly clear about the use case.","commit_id":"a0f77502e82c3f0c474dec65622e68a452ed6725"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"384a751654996220ceb7e024f55c1b37c6851ac2","unresolved":false,"context_lines":[{"line_number":82,"context_line":"    # TODO(mriedem): It would be better from a UX perspective if we could do"},{"line_number":83,"context_line":"    # some validation in the API layer such that if we know we\u0027re going to"},{"line_number":84,"context_line":"    # specify the AZ when creating the volume and that AZ is not in Cinder, we"},{"line_number":85,"context_line":"    # could fail the boot from volume request early with a 400 rather than"},{"line_number":86,"context_line":"    # fail to build the instance on the compute node which results in a"},{"line_number":87,"context_line":"    # NoValidHost error."},{"line_number":88,"context_line":"    return instance.availability_zone"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a1a9d01_548cd87e","line":85,"updated":"2015-09-27 06:38:37.000000000","message":"I agree that the validation should be done in the API level. This is far too late in the process. This will basically result in a reschedule and additional failures ... until the scheduling on all of the hosts are exhausted","commit_id":"a0f77502e82c3f0c474dec65622e68a452ed6725"}]}
