)]}'
{"cinder/tests/unit/volume/drivers/test_rbd.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"41ac762137336062409ac0e7642ed687b4b588e1","unresolved":false,"context_lines":[{"line_number":2047,"context_line":""},{"line_number":2048,"context_line":"        key_mgr \u003d fake_keymgr.fake_api()"},{"line_number":2049,"context_line":""},{"line_number":2050,"context_line":"        def get_key_mgr(*args, **kwargs):"},{"line_number":2051,"context_line":"            # Always return the same instance"},{"line_number":2052,"context_line":"            return key_mgr"},{"line_number":2053,"context_line":""},{"line_number":2054,"context_line":"        self.mock_object(castellan.key_manager, \u0027API\u0027, get_key_mgr)"},{"line_number":2055,"context_line":"        key_id \u003d key_mgr.store(self.context, KeyObject())"},{"line_number":2056,"context_line":"        self.volume_c.encryption_key_id \u003d key_id"},{"line_number":2057,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f96bb07_1d87d311","line":2054,"range":{"start_line":2050,"start_character":0,"end_line":2054,"end_character":67},"updated":"2018-01-23 14:26:40.000000000","message":"-1:\n\n self.mock_object(castellan.key_manager, \u0027API\u0027, key_mgr)","commit_id":"32919b09b0d8347543dacf606b4978877d4ed0bb"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"a7ccaf535f1df8e39af0567fe201d9e4fa54d3fb","unresolved":false,"context_lines":[{"line_number":2047,"context_line":""},{"line_number":2048,"context_line":"        key_mgr \u003d fake_keymgr.fake_api()"},{"line_number":2049,"context_line":""},{"line_number":2050,"context_line":"        def get_key_mgr(*args, **kwargs):"},{"line_number":2051,"context_line":"            # Always return the same instance"},{"line_number":2052,"context_line":"            return key_mgr"},{"line_number":2053,"context_line":""},{"line_number":2054,"context_line":"        self.mock_object(castellan.key_manager, \u0027API\u0027, get_key_mgr)"},{"line_number":2055,"context_line":"        key_id \u003d key_mgr.store(self.context, KeyObject())"},{"line_number":2056,"context_line":"        self.volume_c.encryption_key_id \u003d key_id"},{"line_number":2057,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f96bb07_6f3ad598","line":2054,"range":{"start_line":2050,"start_character":0,"end_line":2054,"end_character":67},"in_reply_to":"7f96bb07_0eea3774","updated":"2018-01-23 16:38:53.000000000","message":"I wrote it wrong, sorry mind slip, it\u0027s return_value\u003dkey_mgr","commit_id":"32919b09b0d8347543dacf606b4978877d4ed0bb"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"ea033e4c6bf07e4ee797523045f87d5e8e236939","unresolved":false,"context_lines":[{"line_number":2047,"context_line":""},{"line_number":2048,"context_line":"        key_mgr \u003d fake_keymgr.fake_api()"},{"line_number":2049,"context_line":""},{"line_number":2050,"context_line":"        def get_key_mgr(*args, **kwargs):"},{"line_number":2051,"context_line":"            # Always return the same instance"},{"line_number":2052,"context_line":"            return key_mgr"},{"line_number":2053,"context_line":""},{"line_number":2054,"context_line":"        self.mock_object(castellan.key_manager, \u0027API\u0027, get_key_mgr)"},{"line_number":2055,"context_line":"        key_id \u003d key_mgr.store(self.context, KeyObject())"},{"line_number":2056,"context_line":"        self.volume_c.encryption_key_id \u003d key_id"},{"line_number":2057,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7f96bb07_0eea3774","line":2054,"range":{"start_line":2050,"start_character":0,"end_line":2054,"end_character":67},"in_reply_to":"7f96bb07_1d87d311","updated":"2018-01-23 15:36:48.000000000","message":"This doesn\u0027t actually work because \"API\" has to be callable.","commit_id":"32919b09b0d8347543dacf606b4978877d4ed0bb"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"41ac762137336062409ac0e7642ed687b4b588e1","unresolved":false,"context_lines":[{"line_number":2059,"context_line":"                    \u0027cipher\u0027: \u0027aes-xts-essiv\u0027,"},{"line_number":2060,"context_line":"                    \u0027key_size\u0027: 256}"},{"line_number":2061,"context_line":""},{"line_number":2062,"context_line":"        with mock.patch(\u0027cinder.volume.drivers.rbd.RBDDriver.\u0027"},{"line_number":2063,"context_line":"                        \u0027_check_encryption_provider\u0027, return_value\u003denc_info):"},{"line_number":2064,"context_line":"            with mock.patch(\u0027cinder.volume.drivers.rbd.open\u0027) as mock_open:"},{"line_number":2065,"context_line":"                with mock.patch.object(self.driver, \u0027_execute\u0027) as mock_exec:"},{"line_number":2066,"context_line":"                    self.driver._create_encrypted_volume(self.volume_c,"},{"line_number":2067,"context_line":"                                                         self.context)"},{"line_number":2068,"context_line":"                    mock_open.assert_called_with(\u0027/passfile\u0027, \u0027w\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f96bb07_7d761709","line":2065,"range":{"start_line":2062,"start_character":0,"end_line":2065,"end_character":77},"updated":"2018-01-23 14:26:40.000000000","message":"nit: I believe it is more readable (and you get a smaller indention in the inside block) with:\n\n        with mock.patch.object(driver.RBDDriver, \u0027_check_encryption_provider\u0027,\n                               return_value\u003denc_info), \\\n                mock.patch.object(driver, \u0027open\u0027) as mock_open, \\\n                mock.patch.object(self.driver, \u0027_execute\u0027) as mock_exec:","commit_id":"32919b09b0d8347543dacf606b4978877d4ed0bb"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"ea033e4c6bf07e4ee797523045f87d5e8e236939","unresolved":false,"context_lines":[{"line_number":2059,"context_line":"                    \u0027cipher\u0027: \u0027aes-xts-essiv\u0027,"},{"line_number":2060,"context_line":"                    \u0027key_size\u0027: 256}"},{"line_number":2061,"context_line":""},{"line_number":2062,"context_line":"        with mock.patch(\u0027cinder.volume.drivers.rbd.RBDDriver.\u0027"},{"line_number":2063,"context_line":"                        \u0027_check_encryption_provider\u0027, return_value\u003denc_info):"},{"line_number":2064,"context_line":"            with mock.patch(\u0027cinder.volume.drivers.rbd.open\u0027) as mock_open:"},{"line_number":2065,"context_line":"                with mock.patch.object(self.driver, \u0027_execute\u0027) as mock_exec:"},{"line_number":2066,"context_line":"                    self.driver._create_encrypted_volume(self.volume_c,"},{"line_number":2067,"context_line":"                                                         self.context)"},{"line_number":2068,"context_line":"                    mock_open.assert_called_with(\u0027/passfile\u0027, \u0027w\u0027)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7f96bb07_aef8e348","line":2065,"range":{"start_line":2062,"start_character":0,"end_line":2065,"end_character":77},"in_reply_to":"7f96bb07_7d761709","updated":"2018-01-23 15:36:48.000000000","message":"Done","commit_id":"32919b09b0d8347543dacf606b4978877d4ed0bb"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"60a118c534c3e8b4f93c0bfac7b01ba09b8b78bc","unresolved":false,"context_lines":[{"line_number":2051,"context_line":"            # Always return the same instance"},{"line_number":2052,"context_line":"            return key_mgr"},{"line_number":2053,"context_line":""},{"line_number":2054,"context_line":"        self.mock_object(castellan.key_manager, \u0027API\u0027, get_key_mgr)"},{"line_number":2055,"context_line":"        key_id \u003d key_mgr.store(self.context, KeyObject())"},{"line_number":2056,"context_line":"        self.volume_c.encryption_key_id \u003d key_id"},{"line_number":2057,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7f96bb07_6fd6552a","line":2054,"updated":"2018-01-23 16:42:07.000000000","message":"This could just be return_value\u003d","commit_id":"1c0bd6a31342d9e529b4ebb0f1ddba86af4188d5"}],"cinder/tests/unit/volume/flows/test_create_volume_flow.py":[{"author":{"_account_id":13157,"name":"Zhao Chao","email":"zhaochao1984@gmail.com","username":"zhaochao"},"change_message_id":"607bf732bbe8e3f7ff2c6bd26764da7bdc58acf5","unresolved":false,"context_lines":[{"line_number":1059,"context_line":"        fake_driver.create_volume_from_backup.assert_called_once_with("},{"line_number":1060,"context_line":"            volume_obj, backup_obj)"},{"line_number":1061,"context_line":"        if driver_error:"},{"line_number":1062,"context_line":"            mock_create_volume.assert_called_once_with(volume_obj, self.ctxt)"},{"line_number":1063,"context_line":"            mock_get_backup_host.assert_called_once_with("},{"line_number":1064,"context_line":"                backup_obj.host, backup_obj.availability_zone)"},{"line_number":1065,"context_line":"            mock_restore_backup.assert_called_once_with(self.ctxt,"}],"source_content_type":"text/x-python","patch_set":2,"id":"7f96bb07_6e7b4927","line":1062,"range":{"start_line":1062,"start_character":67,"end_line":1062,"end_character":76},"updated":"2018-01-18 05:28:47.000000000","message":"Not needed as the context is now got from the volume object.","commit_id":"b1f7a4a8aac302ad46bfb8f21d92e81250f5875a"}],"cinder/volume/drivers/rbd.py":[{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"e27db3444bf845ab6637429dc39e55104e91cb85","unresolved":false,"context_lines":[{"line_number":1346,"context_line":"        keymgr \u003d key_manager.API(CONF)"},{"line_number":1347,"context_line":"        key \u003d keymgr.get(context, encryption[\u0027encryption_key_id\u0027])"},{"line_number":1348,"context_line":"        passphrase \u003d binascii.hexlify(key.get_encoded()).decode(\u0027utf-8\u0027)"},{"line_number":1349,"context_line":"        LOG.debug(\u0027lyarwood - %s\u0027, passphrase)"},{"line_number":1350,"context_line":"        # Decode the dm-crypt style cipher spec into something qemu-img can use"},{"line_number":1351,"context_line":"        cipher_spec \u003d encryption.get(\u0027cipher\u0027, None)"},{"line_number":1352,"context_line":"        key_size \u003d encryption.get(\u0027key_size\u0027, None)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_545a8d82","line":1349,"range":{"start_line":1349,"start_character":8,"end_line":1349,"end_character":46},"updated":"2018-01-18 15:40:40.000000000","message":"Need to remove this debug.  Could be a security issue.","commit_id":"d67241d48cf94a8c3688b0a96a6f7e8187ed6e15"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"1698824c4a7b9004db764f640625bf8687c344bd","unresolved":false,"context_lines":[{"line_number":1346,"context_line":"        keymgr \u003d key_manager.API(CONF)"},{"line_number":1347,"context_line":"        key \u003d keymgr.get(context, encryption[\u0027encryption_key_id\u0027])"},{"line_number":1348,"context_line":"        passphrase \u003d binascii.hexlify(key.get_encoded()).decode(\u0027utf-8\u0027)"},{"line_number":1349,"context_line":"        LOG.debug(\u0027lyarwood - %s\u0027, passphrase)"},{"line_number":1350,"context_line":"        # Decode the dm-crypt style cipher spec into something qemu-img can use"},{"line_number":1351,"context_line":"        cipher_spec \u003d encryption.get(\u0027cipher\u0027, None)"},{"line_number":1352,"context_line":"        key_size \u003d encryption.get(\u0027key_size\u0027, None)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f96bb07_27ceb159","line":1349,"range":{"start_line":1349,"start_character":8,"end_line":1349,"end_character":46},"in_reply_to":"7f96bb07_545a8d82","updated":"2018-01-18 16:03:48.000000000","message":"Whoops, missed that in my patch squashing. :)","commit_id":"d67241d48cf94a8c3688b0a96a6f7e8187ed6e15"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"88fbcbbcc49d90021a0b9ebf1d38865dda5796e9","unresolved":false,"context_lines":[{"line_number":692,"context_line":"        \"\"\""},{"line_number":693,"context_line":""},{"line_number":694,"context_line":"        # Check that this is a LUKS encryption provider"},{"line_number":695,"context_line":"        encryption \u003d self.db.volume_encryption_metadata_get(context, volume.id)"},{"line_number":696,"context_line":"        provider \u003d encryption.get(\u0027provider\u0027, None)"},{"line_number":697,"context_line":"        if provider in encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP:"},{"line_number":698,"context_line":"            provider \u003d encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP[provider]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_180e5d32","line":695,"updated":"2018-01-19 12:00:47.000000000","message":"-1: No accessing the DB directly  :-(\n\nYou\u0027ll need to add the right fields into the Volume OVO so that the encryption metadata can be read.","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"970ba41bc3ebc45521d9fe0ce7511c8ffe47a0e6","unresolved":false,"context_lines":[{"line_number":692,"context_line":"        \"\"\""},{"line_number":693,"context_line":""},{"line_number":694,"context_line":"        # Check that this is a LUKS encryption provider"},{"line_number":695,"context_line":"        encryption \u003d self.db.volume_encryption_metadata_get(context, volume.id)"},{"line_number":696,"context_line":"        provider \u003d encryption.get(\u0027provider\u0027, None)"},{"line_number":697,"context_line":"        if provider in encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP:"},{"line_number":698,"context_line":"            provider \u003d encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP[provider]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_2a3734e6","line":695,"in_reply_to":"7f96bb07_180e5d32","updated":"2018-01-19 16:48:57.000000000","message":"We don\u0027t have an Encryption OVO object yet to enable this, and we are already doing the same call in the base driver here:\n\n    https://git.openstack.org/cgit/openstack/cinder/tree/cinder/volume/driver.py?h\u003d12.0.0.0b2#n815\n\nI think handling this cleanly via OVO can wait until later since this is currently being done by other drivers in the same way.","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"919fe308ac0bf9d1788a825835fba72bbe1f333e","unresolved":false,"context_lines":[{"line_number":692,"context_line":"        \"\"\""},{"line_number":693,"context_line":""},{"line_number":694,"context_line":"        # Check that this is a LUKS encryption provider"},{"line_number":695,"context_line":"        encryption \u003d self.db.volume_encryption_metadata_get(context, volume.id)"},{"line_number":696,"context_line":"        provider \u003d encryption.get(\u0027provider\u0027, None)"},{"line_number":697,"context_line":"        if provider in encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP:"},{"line_number":698,"context_line":"            provider \u003d encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP[provider]"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_45dcca17","line":695,"in_reply_to":"7f96bb07_2a3734e6","updated":"2018-01-22 13:11:45.000000000","message":"The OVO mechanism to get this data should have been implemented for the base driver, and now it would be unfair to impose that restriction on the RBD driver when the base driver is already doing this.  :-(\n\nWe\u0027ll leave the OVO stuff for later, but it would be nice to have a TODO here mentioning it.","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"88fbcbbcc49d90021a0b9ebf1d38865dda5796e9","unresolved":false,"context_lines":[{"line_number":697,"context_line":"        if provider in encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP:"},{"line_number":698,"context_line":"            provider \u003d encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP[provider]"},{"line_number":699,"context_line":"        if provider !\u003d encryptors.LUKS:"},{"line_number":700,"context_line":"            message \u003d _(\"Provider not supported.\")"},{"line_number":701,"context_line":"            raise exception.VolumeDriverException(message\u003dmessage)"},{"line_number":702,"context_line":""},{"line_number":703,"context_line":"        # Fetch the key associated with the volume and decode the passphrase"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_58f625fc","line":700,"updated":"2018-01-19 12:00:47.000000000","message":"nit: I think we should add the provider to the message","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"88fbcbbcc49d90021a0b9ebf1d38865dda5796e9","unresolved":false,"context_lines":[{"line_number":714,"context_line":"                    f.write(passphrase)"},{"line_number":715,"context_line":""},{"line_number":716,"context_line":"                cipher_args \u003d image_utils.decode_cipher("},{"line_number":717,"context_line":"                    encryption.get(\u0027cipher\u0027),"},{"line_number":718,"context_line":"                    encryption.get(\u0027key_size\u0027))"},{"line_number":719,"context_line":""},{"line_number":720,"context_line":"                create_cmd \u003d ("},{"line_number":721,"context_line":"                    \u0027qemu-img\u0027, \u0027create\u0027, \u0027-f\u0027, \u0027luks\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_588625de","line":718,"range":{"start_line":717,"start_character":0,"end_line":718,"end_character":47},"updated":"2018-01-19 12:00:47.000000000","message":"?: We use .get when then keys may not be present, but if they are not present the decode_cipher method will crash.\n\nWe either expected them to always be present\n\n encryption[\u0027cipher\u0027]\n\nOr we protect our code to not break when it\u0027s not present","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"88fbcbbcc49d90021a0b9ebf1d38865dda5796e9","unresolved":false,"context_lines":[{"line_number":717,"context_line":"                    encryption.get(\u0027cipher\u0027),"},{"line_number":718,"context_line":"                    encryption.get(\u0027key_size\u0027))"},{"line_number":719,"context_line":""},{"line_number":720,"context_line":"                create_cmd \u003d ("},{"line_number":721,"context_line":"                    \u0027qemu-img\u0027, \u0027create\u0027, \u0027-f\u0027, \u0027luks\u0027,"},{"line_number":722,"context_line":"                    \u0027-o\u0027, \u0027cipher-alg\u003d%(cipher_alg)s,\u0027"},{"line_number":723,"context_line":"                    \u0027cipher-mode\u003d%(cipher_mode)s,\u0027"},{"line_number":724,"context_line":"                    \u0027ivgen-alg\u003d%(ivgen_alg)s\u0027 % cipher_args,"},{"line_number":725,"context_line":"                    \u0027--object\u0027, \u0027secret,id\u003dluks_sec,\u0027"},{"line_number":726,"context_line":"                    \u0027format\u003draw,file\u003d%(passfile)s\u0027 % {\u0027passfile\u0027:"},{"line_number":727,"context_line":"                                                      tmp_key.name},"},{"line_number":728,"context_line":"                    \u0027-o\u0027, \u0027key-secret\u003dluks_sec\u0027,"},{"line_number":729,"context_line":"                    tmp_image.name,"},{"line_number":730,"context_line":"                    \u0027%sM\u0027 % (volume.size * 1024))"},{"line_number":731,"context_line":"                self._execute(*create_cmd)"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":"            # Copy image into RBD"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_58bb8571","line":730,"range":{"start_line":720,"start_character":0,"end_line":730,"end_character":49},"updated":"2018-01-19 12:00:47.000000000","message":"?: Couldn\u0027t we just make this use the _convert_image method like we do in the _encrypt_image?  I know we may have to introduce some changes there, but I think it may be reasonable instead of duplicating things here...","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"984a0b0956e9e5bb6f72a980603c25380d5dd5d0","unresolved":false,"context_lines":[{"line_number":717,"context_line":"                    encryption.get(\u0027cipher\u0027),"},{"line_number":718,"context_line":"                    encryption.get(\u0027key_size\u0027))"},{"line_number":719,"context_line":""},{"line_number":720,"context_line":"                create_cmd \u003d ("},{"line_number":721,"context_line":"                    \u0027qemu-img\u0027, \u0027create\u0027, \u0027-f\u0027, \u0027luks\u0027,"},{"line_number":722,"context_line":"                    \u0027-o\u0027, \u0027cipher-alg\u003d%(cipher_alg)s,\u0027"},{"line_number":723,"context_line":"                    \u0027cipher-mode\u003d%(cipher_mode)s,\u0027"},{"line_number":724,"context_line":"                    \u0027ivgen-alg\u003d%(ivgen_alg)s\u0027 % cipher_args,"},{"line_number":725,"context_line":"                    \u0027--object\u0027, \u0027secret,id\u003dluks_sec,\u0027"},{"line_number":726,"context_line":"                    \u0027format\u003draw,file\u003d%(passfile)s\u0027 % {\u0027passfile\u0027:"},{"line_number":727,"context_line":"                                                      tmp_key.name},"},{"line_number":728,"context_line":"                    \u0027-o\u0027, \u0027key-secret\u003dluks_sec\u0027,"},{"line_number":729,"context_line":"                    tmp_image.name,"},{"line_number":730,"context_line":"                    \u0027%sM\u0027 % (volume.size * 1024))"},{"line_number":731,"context_line":"                self._execute(*create_cmd)"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":"            # Copy image into RBD"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_cc9eedb7","line":730,"range":{"start_line":720,"start_character":0,"end_line":730,"end_character":49},"in_reply_to":"7f96bb07_58bb8571","updated":"2018-01-22 22:34:21.000000000","message":"I\u0027m not sure, this isn\u0027t a convert operation, and _convert_image has already sprawled into a fairly large thing.","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"41ac762137336062409ac0e7642ed687b4b588e1","unresolved":false,"context_lines":[{"line_number":717,"context_line":"                    encryption.get(\u0027cipher\u0027),"},{"line_number":718,"context_line":"                    encryption.get(\u0027key_size\u0027))"},{"line_number":719,"context_line":""},{"line_number":720,"context_line":"                create_cmd \u003d ("},{"line_number":721,"context_line":"                    \u0027qemu-img\u0027, \u0027create\u0027, \u0027-f\u0027, \u0027luks\u0027,"},{"line_number":722,"context_line":"                    \u0027-o\u0027, \u0027cipher-alg\u003d%(cipher_alg)s,\u0027"},{"line_number":723,"context_line":"                    \u0027cipher-mode\u003d%(cipher_mode)s,\u0027"},{"line_number":724,"context_line":"                    \u0027ivgen-alg\u003d%(ivgen_alg)s\u0027 % cipher_args,"},{"line_number":725,"context_line":"                    \u0027--object\u0027, \u0027secret,id\u003dluks_sec,\u0027"},{"line_number":726,"context_line":"                    \u0027format\u003draw,file\u003d%(passfile)s\u0027 % {\u0027passfile\u0027:"},{"line_number":727,"context_line":"                                                      tmp_key.name},"},{"line_number":728,"context_line":"                    \u0027-o\u0027, \u0027key-secret\u003dluks_sec\u0027,"},{"line_number":729,"context_line":"                    tmp_image.name,"},{"line_number":730,"context_line":"                    \u0027%sM\u0027 % (volume.size * 1024))"},{"line_number":731,"context_line":"                self._execute(*create_cmd)"},{"line_number":732,"context_line":""},{"line_number":733,"context_line":"            # Copy image into RBD"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_60874a63","line":730,"range":{"start_line":720,"start_character":0,"end_line":730,"end_character":49},"in_reply_to":"7f96bb07_cc9eedb7","updated":"2018-01-23 14:26:40.000000000","message":"Fair enough.","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"88fbcbbcc49d90021a0b9ebf1d38865dda5796e9","unresolved":false,"context_lines":[{"line_number":1332,"context_line":"    def _encrypt_image(self, context, volume, tmp_dir, src_image_path):"},{"line_number":1333,"context_line":""},{"line_number":1334,"context_line":"        # Fetch the encryption dict for the volume"},{"line_number":1335,"context_line":"        encryption \u003d self.db.volume_encryption_metadata_get(context, volume.id)"},{"line_number":1336,"context_line":""},{"line_number":1337,"context_line":"        # Check that this is a LUKS encryption provider"},{"line_number":1338,"context_line":"        provider \u003d encryption.get(\u0027provider\u0027, None)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_98090d97","line":1335,"updated":"2018-01-19 12:00:47.000000000","message":"-1: No accessing the DB directly","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"88fbcbbcc49d90021a0b9ebf1d38865dda5796e9","unresolved":false,"context_lines":[{"line_number":1332,"context_line":"    def _encrypt_image(self, context, volume, tmp_dir, src_image_path):"},{"line_number":1333,"context_line":""},{"line_number":1334,"context_line":"        # Fetch the encryption dict for the volume"},{"line_number":1335,"context_line":"        encryption \u003d self.db.volume_encryption_metadata_get(context, volume.id)"},{"line_number":1336,"context_line":""},{"line_number":1337,"context_line":"        # Check that this is a LUKS encryption provider"},{"line_number":1338,"context_line":"        provider \u003d encryption.get(\u0027provider\u0027, None)"},{"line_number":1339,"context_line":"        if provider in encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP:"},{"line_number":1340,"context_line":"            provider \u003d encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP[provider]"},{"line_number":1341,"context_line":"        if provider !\u003d encryptors.LUKS:"},{"line_number":1342,"context_line":"            message \u003d _(\"Provider not supported.\")"},{"line_number":1343,"context_line":"            raise exception.VolumeDriverException(message\u003dmessage)"},{"line_number":1344,"context_line":""},{"line_number":1345,"context_line":"        # Fetch the key associated with the volume and decode the passphrase"},{"line_number":1346,"context_line":"        keymgr \u003d key_manager.API(CONF)"},{"line_number":1347,"context_line":"        key \u003d keymgr.get(context, encryption[\u0027encryption_key_id\u0027])"},{"line_number":1348,"context_line":"        passphrase \u003d binascii.hexlify(key.get_encoded()).decode(\u0027utf-8\u0027)"},{"line_number":1349,"context_line":""},{"line_number":1350,"context_line":"        # Decode the dm-crypt style cipher spec into something qemu-img can use"},{"line_number":1351,"context_line":"        cipher_spec \u003d encryption.get(\u0027cipher\u0027, None)"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_38331965","line":1348,"range":{"start_line":1335,"start_character":0,"end_line":1348,"end_character":72},"updated":"2018-01-19 12:00:47.000000000","message":"-1: This is the same as in the _create_encrypted_volume method","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"88fbcbbcc49d90021a0b9ebf1d38865dda5796e9","unresolved":false,"context_lines":[{"line_number":1349,"context_line":""},{"line_number":1350,"context_line":"        # Decode the dm-crypt style cipher spec into something qemu-img can use"},{"line_number":1351,"context_line":"        cipher_spec \u003d encryption.get(\u0027cipher\u0027, None)"},{"line_number":1352,"context_line":"        key_size \u003d encryption.get(\u0027key_size\u0027, None)"},{"line_number":1353,"context_line":"        if cipher_spec is not None:"},{"line_number":1354,"context_line":"            cipher_spec \u003d image_utils.decode_cipher(cipher_spec, key_size)"},{"line_number":1355,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_d84a35ab","line":1352,"updated":"2018-01-19 12:00:47.000000000","message":"?: Is it possible for the key_size to not be present and for a cipher to be present due to a configuration error?  I assume not, but wanted to make sure, because if it\u0027s possible then the call to decode_cipher could break.","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"88fbcbbcc49d90021a0b9ebf1d38865dda5796e9","unresolved":false,"context_lines":[{"line_number":1365,"context_line":"                                      cipher_spec\u003dcipher_spec,"},{"line_number":1366,"context_line":"                                      passphrase_file\u003dpassphrase_file)"},{"line_number":1367,"context_line":""},{"line_number":1368,"context_line":"            # Replce the original image with the now encrypted image"},{"line_number":1369,"context_line":"            os.rename(dest_image_path, src_image_path)"},{"line_number":1370,"context_line":""},{"line_number":1371,"context_line":"    def _copy_image_to_volume(self, context, volume, image_service, image_id,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7f96bb07_d8f8f54a","line":1368,"range":{"start_line":1368,"start_character":14,"end_line":1368,"end_character":20},"updated":"2018-01-19 12:00:47.000000000","message":"nit: Replace","commit_id":"a5fc119bce5e03a97a2d9cfe5266661e703e394a"},{"author":{"_account_id":19853,"name":"Nguyen Hung Phuong","email":"phuongnh@vn.fujitsu.com","username":"phuongnh"},"change_message_id":"1ab50b41cd418629f8458406161d1e2a970207a1","unresolved":false,"context_lines":[{"line_number":695,"context_line":"        if provider in encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP:"},{"line_number":696,"context_line":"            provider \u003d encryptors.LEGACY_PROVIDER_CLASS_TO_FORMAT_MAP[provider]"},{"line_number":697,"context_line":"        if provider !\u003d encryptors.LUKS:"},{"line_number":698,"context_line":"            message \u003d _(\"Provider %s not supported.\" % provider)"},{"line_number":699,"context_line":"            raise exception.VolumeDriverException(message\u003dmessage)"},{"line_number":700,"context_line":""},{"line_number":701,"context_line":"        if \u0027cipher\u0027 not in encryption or \u0027key_size\u0027 not in encryption:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7f96bb07_cc9a30c4","line":698,"range":{"start_line":698,"start_character":53,"end_line":698,"end_character":63},"updated":"2018-01-23 01:40:01.000000000","message":"should be outside of parentheses","commit_id":"ad1cc4e84c76bf4d27622ca314a9c31ce39b2a72"}]}
