)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":20105,"name":"Cao ShuFeng","email":"caosf.fnst@cn.fujitsu.com","username":"caosf.fnst"},"change_message_id":"2bd9ac9ab7b8db35b41b878df9ccb033bee2a14c","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Fix of finding out available cinder volume services"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently when creating a volume from source volume or snapshot,"},{"line_number":10,"context_line":"it should check whether there are only one available cinder-volume"},{"line_number":11,"context_line":"services."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Instead it checks whether there are only one disabled cinder-volume"},{"line_number":14,"context_line":"services. This bug is to fix the problem."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"7aa08908_104fcf6b","line":11,"range":{"start_line":10,"start_character":0,"end_line":11,"end_character":9},"updated":"2016-06-08 10:26:09.000000000","message":"(nit): we need to update it now.","commit_id":"50aaabc8dc4c5c06a1989fb1f6e2eef03c2a1293"}],"cinder/tests/unit/test_volume.py":[{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"01b2999809118a6ff0bad30a4ed12d9ac74d8a0f","unresolved":false,"context_lines":[{"line_number":1325,"context_line":"        snapshot_obj \u003d fake_snapshot.fake_snapshot_obj(self.context,"},{"line_number":1326,"context_line":"                                                       **snapshot)"},{"line_number":1327,"context_line":""},{"line_number":1328,"context_line":"        source_vol \u003d {\u0027id\u0027: fake.VOLUME_ID,"},{"line_number":1329,"context_line":"                      \u0027status\u0027: \u0027available\u0027,"},{"line_number":1330,"context_line":"                      \u0027volume_size\u0027: 10,"},{"line_number":1331,"context_line":"                      \u0027volume_type\u0027: biz_type,"},{"line_number":1332,"context_line":"                      \u0027volume_type_id\u0027: biz_type[\u0027id\u0027],"},{"line_number":1333,"context_line":"                      \u0027host\u0027: \u0027testhost@dev_2\u0027}"},{"line_number":1334,"context_line":""},{"line_number":1335,"context_line":"        with mock.patch.object(objects.Volume,"},{"line_number":1336,"context_line":"                               \u0027get_by_id\u0027) as mock_get_volume:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_3048625b","line":1333,"range":{"start_line":1328,"start_character":0,"end_line":1333,"end_character":47},"updated":"2016-07-05 13:13:10.000000000","message":"Can we use fake_volume.fake_volume_obj instead?","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6368996e5d8ea870e8698c03df5ddf4449c52134","unresolved":false,"context_lines":[{"line_number":1325,"context_line":"        snapshot_obj \u003d fake_snapshot.fake_snapshot_obj(self.context,"},{"line_number":1326,"context_line":"                                                       **snapshot)"},{"line_number":1327,"context_line":""},{"line_number":1328,"context_line":"        source_vol \u003d {\u0027id\u0027: fake.VOLUME_ID,"},{"line_number":1329,"context_line":"                      \u0027status\u0027: \u0027available\u0027,"},{"line_number":1330,"context_line":"                      \u0027volume_size\u0027: 10,"},{"line_number":1331,"context_line":"                      \u0027volume_type\u0027: biz_type,"},{"line_number":1332,"context_line":"                      \u0027volume_type_id\u0027: biz_type[\u0027id\u0027],"},{"line_number":1333,"context_line":"                      \u0027host\u0027: \u0027testhost@dev_2\u0027}"},{"line_number":1334,"context_line":""},{"line_number":1335,"context_line":"        with mock.patch.object(objects.Volume,"},{"line_number":1336,"context_line":"                               \u0027get_by_id\u0027) as mock_get_volume:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a74a57a_fbc54c0a","line":1333,"range":{"start_line":1328,"start_character":0,"end_line":1333,"end_character":47},"in_reply_to":"1aa78d24_3048625b","updated":"2016-11-30 06:23:17.000000000","message":"Done","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"01b2999809118a6ff0bad30a4ed12d9ac74d8a0f","unresolved":false,"context_lines":[{"line_number":1487,"context_line":"            \u0027id\u0027: \u002734e54c31-3bc8-5c1d-9fff-2225bcce4b59\u0027,"},{"line_number":1488,"context_line":"            \u0027description\u0027: None}"},{"line_number":1489,"context_line":""},{"line_number":1490,"context_line":"        source_vol \u003d {\u0027id\u0027: fake.VOLUME_ID,"},{"line_number":1491,"context_line":"                      \u0027status\u0027: \u0027available\u0027,"},{"line_number":1492,"context_line":"                      \u0027volume_size\u0027: 10,"},{"line_number":1493,"context_line":"                      \u0027volume_type\u0027: biz_type,"},{"line_number":1494,"context_line":"                      \u0027volume_type_id\u0027: biz_type[\u0027id\u0027],"},{"line_number":1495,"context_line":"                      \u0027host\u0027: \u0027testhost@backend\u0027}"},{"line_number":1496,"context_line":""},{"line_number":1497,"context_line":"        snapshot \u003d {\u0027id\u0027: fake.SNAPSHOT_ID,"},{"line_number":1498,"context_line":"                    \u0027status\u0027: fields.SnapshotStatus.AVAILABLE,"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_90831656","line":1495,"range":{"start_line":1490,"start_character":0,"end_line":1495,"end_character":49},"updated":"2016-07-05 13:13:10.000000000","message":"Same here.","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6368996e5d8ea870e8698c03df5ddf4449c52134","unresolved":false,"context_lines":[{"line_number":1487,"context_line":"            \u0027id\u0027: \u002734e54c31-3bc8-5c1d-9fff-2225bcce4b59\u0027,"},{"line_number":1488,"context_line":"            \u0027description\u0027: None}"},{"line_number":1489,"context_line":""},{"line_number":1490,"context_line":"        source_vol \u003d {\u0027id\u0027: fake.VOLUME_ID,"},{"line_number":1491,"context_line":"                      \u0027status\u0027: \u0027available\u0027,"},{"line_number":1492,"context_line":"                      \u0027volume_size\u0027: 10,"},{"line_number":1493,"context_line":"                      \u0027volume_type\u0027: biz_type,"},{"line_number":1494,"context_line":"                      \u0027volume_type_id\u0027: biz_type[\u0027id\u0027],"},{"line_number":1495,"context_line":"                      \u0027host\u0027: \u0027testhost@backend\u0027}"},{"line_number":1496,"context_line":""},{"line_number":1497,"context_line":"        snapshot \u003d {\u0027id\u0027: fake.SNAPSHOT_ID,"},{"line_number":1498,"context_line":"                    \u0027status\u0027: fields.SnapshotStatus.AVAILABLE,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a74a57a_3bd0a4c9","line":1495,"range":{"start_line":1490,"start_character":0,"end_line":1495,"end_character":49},"in_reply_to":"1aa78d24_90831656","updated":"2016-11-30 06:23:17.000000000","message":"Done","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"}],"cinder/volume/api.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"8b197c4f1191fb360b00be6a564a7efb87b4a4c2","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        elevated \u003d context.elevated()"},{"line_number":181,"context_line":"        services \u003d objects.ServiceList.get_all_by_topic(elevated,"},{"line_number":182,"context_line":"                                                        \u0027cinder-volume\u0027,"},{"line_number":183,"context_line":"                                                        disabled\u003dFalse)"},{"line_number":184,"context_line":"        if len(services.objects) \u003d\u003d 1:"},{"line_number":185,"context_line":"            safe \u003d True"},{"line_number":186,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_8804554a","line":183,"updated":"2016-04-20 08:55:42.000000000","message":"I believe this whole logic is wrong, or at least doesn\u0027t make any sense to me, and it looks as wrong to check for disabled services as it does to check for non disabled services.\n\nWe should get ALL services regardless of whether they are disabled or not and then check if the retype is possible.\n\nWith this change we would consider that retype is possible just because there is only 1 volume service that is not disabled, which doesn\u0027t make much sense since we may need to do the retype to a service that is disabled.","commit_id":"e2739bdbb5367eb5531de85474e34fc66ecd4421"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"bf4a83e4b95330fe35a76e7513b3b965cbc9030f","unresolved":false,"context_lines":[{"line_number":180,"context_line":"        elevated \u003d context.elevated()"},{"line_number":181,"context_line":"        services \u003d objects.ServiceList.get_all_by_topic(elevated,"},{"line_number":182,"context_line":"                                                        \u0027cinder-volume\u0027,"},{"line_number":183,"context_line":"                                                        disabled\u003dFalse)"},{"line_number":184,"context_line":"        if len(services.objects) \u003d\u003d 1:"},{"line_number":185,"context_line":"            safe \u003d True"},{"line_number":186,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1a122d0e_5100f333","line":183,"in_reply_to":"1a122d0e_8804554a","updated":"2016-04-21 03:03:13.000000000","message":"You are right, Gorka.\nThe function name is confusing. \nIn fact it is not related to retype.\n\nThe _retype_is_possible is called when creating a source volume from source volume or snapshot:\n\nI looked into the whole logic of creating volume. And I think this function check is not needed. \n\nAs during creating volume, the host of source volume and snapshot host will be given to the new volume, and then schedule.\n\nhttps://github.com/openstack/cinder/blob/master/cinder/volume/flows/api/create_volume.py#L780-L805\n\nAnother problem here:\n\nWe should check whether encryptions are same. If same, we start continue here. I opened another bug to fix the problem.\n\nhttps://bugs.launchpad.net/cinder/+bug/1572007\nhttps://bugs.launchpad.net/cinder/+bug/1572009","commit_id":"e2739bdbb5367eb5531de85474e34fc66ecd4421"},{"author":{"_account_id":20105,"name":"Cao ShuFeng","email":"caosf.fnst@cn.fujitsu.com","username":"caosf.fnst"},"change_message_id":"2bd9ac9ab7b8db35b41b878df9ccb033bee2a14c","unresolved":false,"context_lines":[{"line_number":176,"context_line":"    def _retype_is_possible(self, context,"},{"line_number":177,"context_line":"                            target_type,"},{"line_number":178,"context_line":"                            target_host):"},{"line_number":179,"context_line":"        safe \u003d True"},{"line_number":180,"context_line":"        type_backend_name \u003d ("},{"line_number":181,"context_line":"            target_type.get(\u0027extra_specs\u0027).get(\u0027volume_backend_name\u0027))"},{"line_number":182,"context_line":"        if type_backend_name:"},{"line_number":183,"context_line":"            host \u003d volume_utils.extract_host(target_host, \u0027backend\u0027)"},{"line_number":184,"context_line":"            target_backend \u003d host.split(\u0027@\u0027)[1]"},{"line_number":185,"context_line":"            if target_backend !\u003d type_backend_name:"},{"line_number":186,"context_line":"                safe \u003d False"},{"line_number":187,"context_line":"        return safe"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"    def _is_volume_migrating(self, volume):"}],"source_content_type":"text/x-python","patch_set":3,"id":"7aa08908_4d6b80f1","line":186,"range":{"start_line":179,"start_character":0,"end_line":186,"end_character":28},"updated":"2016-06-08 10:26:09.000000000","message":"LGTM.\nThe best way to check this is comparing the host\u0027s capabilities with type\u0027s extra_specs, just like this[1].\n\nBut the host\u0027s capabilities is only stored cinder-scheduler\u0027s memory, so in cinder-api we can only check the backend_name.\n\n[1]: https://github.com/openstack/cinder/blob/master/cinder/scheduler/filters/capabilities_filter.py#L28","commit_id":"50aaabc8dc4c5c06a1989fb1f6e2eef03c2a1293"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"01b2999809118a6ff0bad30a4ed12d9ac74d8a0f","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            type_b \u003d second_type or volume_types.get_volume_type("},{"line_number":190,"context_line":"                elevated,"},{"line_number":191,"context_line":"                second_type_id)"},{"line_number":192,"context_line":"            if (volume_utils.matching_backend_name(type_a[\u0027extra_specs\u0027],"},{"line_number":193,"context_line":"                                                   type_b[\u0027extra_specs\u0027])):"},{"line_number":194,"context_line":"                safe \u003d True"},{"line_number":195,"context_line":"        return safe"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_edfe0537","side":"PARENT","line":192,"range":{"start_line":192,"start_character":29,"end_line":192,"end_character":50},"updated":"2016-07-05 13:13:10.000000000","message":"This is the only usage of this method, so please either reuse it to hide lines 182-184, or remove it.","commit_id":"60b3dfdb0247a28873dd7b732b8e4b6bc77611c5"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"01b2999809118a6ff0bad30a4ed12d9ac74d8a0f","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        LOG.info(_LI(\"Availability Zones retrieved successfully.\"))"},{"line_number":173,"context_line":"        return tuple(azs)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def _retype_is_possible(self, context,"},{"line_number":176,"context_line":"                            target_type,"},{"line_number":177,"context_line":"                            target_host):"},{"line_number":178,"context_line":"        safe \u003d True"},{"line_number":179,"context_line":"        type_backend_name \u003d ("},{"line_number":180,"context_line":"            target_type.get(\u0027extra_specs\u0027).get(\u0027volume_backend_name\u0027))"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_6dd7b523","line":177,"range":{"start_line":175,"start_character":0,"end_line":177,"end_character":41},"updated":"2016-07-05 13:13:10.000000000","message":"We can squeeze that into a single line now.","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6368996e5d8ea870e8698c03df5ddf4449c52134","unresolved":false,"context_lines":[{"line_number":172,"context_line":"        LOG.info(_LI(\"Availability Zones retrieved successfully.\"))"},{"line_number":173,"context_line":"        return tuple(azs)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def _retype_is_possible(self, context,"},{"line_number":176,"context_line":"                            target_type,"},{"line_number":177,"context_line":"                            target_host):"},{"line_number":178,"context_line":"        safe \u003d True"},{"line_number":179,"context_line":"        type_backend_name \u003d ("},{"line_number":180,"context_line":"            target_type.get(\u0027extra_specs\u0027).get(\u0027volume_backend_name\u0027))"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a74a57a_b84affaa","line":177,"range":{"start_line":175,"start_character":0,"end_line":177,"end_character":41},"in_reply_to":"1aa78d24_6dd7b523","updated":"2016-11-30 06:23:17.000000000","message":"Done","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"01b2999809118a6ff0bad30a4ed12d9ac74d8a0f","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                if not self._retype_is_possible("},{"line_number":244,"context_line":"                        context,"},{"line_number":245,"context_line":"                        volume_type,"},{"line_number":246,"context_line":"                        source_volume.get(\u0027host\u0027)):"},{"line_number":247,"context_line":"                    msg \u003d _(\"Invalid volume_type provided: %s (requested type \""},{"line_number":248,"context_line":"                            \"is not compatible; either match source volume, \""},{"line_number":249,"context_line":"                            \"or omit type argument).\") % volume_type[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_70030a0e","line":246,"range":{"start_line":246,"start_character":24,"end_line":246,"end_character":48},"updated":"2016-07-05 13:13:10.000000000","message":"Why not:\n\n source_volume.host\n\n?","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6368996e5d8ea870e8698c03df5ddf4449c52134","unresolved":false,"context_lines":[{"line_number":243,"context_line":"                if not self._retype_is_possible("},{"line_number":244,"context_line":"                        context,"},{"line_number":245,"context_line":"                        volume_type,"},{"line_number":246,"context_line":"                        source_volume.get(\u0027host\u0027)):"},{"line_number":247,"context_line":"                    msg \u003d _(\"Invalid volume_type provided: %s (requested type \""},{"line_number":248,"context_line":"                            \"is not compatible; either match source volume, \""},{"line_number":249,"context_line":"                            \"or omit type argument).\") % volume_type[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a74a57a_d8ec1b95","line":246,"range":{"start_line":246,"start_character":24,"end_line":246,"end_character":48},"in_reply_to":"1aa78d24_70030a0e","updated":"2016-11-30 06:23:17.000000000","message":"Done","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"01b2999809118a6ff0bad30a4ed12d9ac74d8a0f","unresolved":false,"context_lines":[{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        if snapshot and volume_type:"},{"line_number":259,"context_line":"            if volume_type[\u0027id\u0027] !\u003d snapshot.volume_type_id:"},{"line_number":260,"context_line":"                src_volume \u003d objects.Volume.get_by_id(context,"},{"line_number":261,"context_line":"                                                      snapshot.volume_id)"},{"line_number":262,"context_line":"                if not self._retype_is_possible(context,"},{"line_number":263,"context_line":"                                                volume_type,"},{"line_number":264,"context_line":"                                                src_volume.get(\u0027host\u0027)):"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_ed5a854f","line":261,"range":{"start_line":260,"start_character":0,"end_line":261,"end_character":73},"updated":"2016-07-05 13:13:10.000000000","message":"I think we can use object lazy-loading here:\n\n src_volume \u003d snapshot.volume\n\nAm I right, or is this failing with OrphanedObject exception?","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6368996e5d8ea870e8698c03df5ddf4449c52134","unresolved":false,"context_lines":[{"line_number":257,"context_line":""},{"line_number":258,"context_line":"        if snapshot and volume_type:"},{"line_number":259,"context_line":"            if volume_type[\u0027id\u0027] !\u003d snapshot.volume_type_id:"},{"line_number":260,"context_line":"                src_volume \u003d objects.Volume.get_by_id(context,"},{"line_number":261,"context_line":"                                                      snapshot.volume_id)"},{"line_number":262,"context_line":"                if not self._retype_is_possible(context,"},{"line_number":263,"context_line":"                                                volume_type,"},{"line_number":264,"context_line":"                                                src_volume.get(\u0027host\u0027)):"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a74a57a_bbe4b4ac","line":261,"range":{"start_line":260,"start_character":0,"end_line":261,"end_character":73},"in_reply_to":"1aa78d24_ed5a854f","updated":"2016-11-30 06:23:17.000000000","message":"Done","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"01b2999809118a6ff0bad30a4ed12d9ac74d8a0f","unresolved":false,"context_lines":[{"line_number":261,"context_line":"                                                      snapshot.volume_id)"},{"line_number":262,"context_line":"                if not self._retype_is_possible(context,"},{"line_number":263,"context_line":"                                                volume_type,"},{"line_number":264,"context_line":"                                                src_volume.get(\u0027host\u0027)):"},{"line_number":265,"context_line":"                    msg \u003d _(\"Invalid volume_type provided: %s (requested \""},{"line_number":266,"context_line":"                            \"type is not compatible; recommend omitting \""},{"line_number":267,"context_line":"                            \"the type argument).\") % volume_type[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"1aa78d24_702aea7f","line":264,"range":{"start_line":264,"start_character":48,"end_line":264,"end_character":70},"updated":"2016-07-05 13:13:10.000000000","message":"Is \n\n src_volume.host\n\nnot working in this case?","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"},{"author":{"_account_id":15961,"name":"lisali","email":"xiaoyan.li@intel.com","username":"lisali"},"change_message_id":"6368996e5d8ea870e8698c03df5ddf4449c52134","unresolved":false,"context_lines":[{"line_number":261,"context_line":"                                                      snapshot.volume_id)"},{"line_number":262,"context_line":"                if not self._retype_is_possible(context,"},{"line_number":263,"context_line":"                                                volume_type,"},{"line_number":264,"context_line":"                                                src_volume.get(\u0027host\u0027)):"},{"line_number":265,"context_line":"                    msg \u003d _(\"Invalid volume_type provided: %s (requested \""},{"line_number":266,"context_line":"                            \"type is not compatible; recommend omitting \""},{"line_number":267,"context_line":"                            \"the type argument).\") % volume_type[\u0027id\u0027]"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a74a57a_3be7c4ad","line":264,"range":{"start_line":264,"start_character":48,"end_line":264,"end_character":70},"in_reply_to":"1aa78d24_702aea7f","updated":"2016-11-30 06:23:17.000000000","message":"Done","commit_id":"797c4c3d0d70f86b84608ed79ef4dd49ff608299"}]}
