)]}'
{"etc/nova/rootwrap.d/compute.filters":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d513a10bb42e5a3cc5c4e685f84eed98dd68f70c","unresolved":false,"context_lines":[{"line_number":213,"context_line":""},{"line_number":214,"context_line":"# nova/volume/encryptors/cryptsetup.py:"},{"line_number":215,"context_line":"# nova/volume/encryptors/luks.py:"},{"line_number":216,"context_line":"ln: RegExpFilter, ln, root, ln, --symbolic, --force, /dev/mapper/crypt-.*, /dev/(?:mapper|disk/by-path)/.*"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"# nova/volume/encryptors.py:"},{"line_number":219,"context_line":"# nova/virt/libvirt/dmcrypt.py:"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"ba15a1d1_bb5e8810","line":216,"updated":"2015-09-15 10:29:46.000000000","message":"not sure we need to restrict this further, I think there were some bugs we had before that meant we had to relax this:\nhttps://github.com/openstack/nova/commit/0facd1f89edfd88188662e0cac274a136a424c3d\n\nNote the NFS example.","commit_id":"87dac4b7bd09b513620b5f991457564a278d2dd3"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"0ab63aa22ffb8b6512e564a1b2f3be9f619db105","unresolved":false,"context_lines":[{"line_number":213,"context_line":""},{"line_number":214,"context_line":"# nova/volume/encryptors/cryptsetup.py:"},{"line_number":215,"context_line":"# nova/volume/encryptors/luks.py:"},{"line_number":216,"context_line":"ln: RegExpFilter, ln, root, ln, --symbolic, --force, /dev/mapper/crypt-.*, /dev/(?:mapper|disk/by-path)/.*"},{"line_number":217,"context_line":""},{"line_number":218,"context_line":"# nova/volume/encryptors.py:"},{"line_number":219,"context_line":"# nova/virt/libvirt/dmcrypt.py:"}],"source_content_type":"application/octet-stream","patch_set":4,"id":"ba15a1d1_2893fe50","line":216,"in_reply_to":"ba15a1d1_bb5e8810","updated":"2015-09-15 18:14:40.000000000","message":"OK, I\u0027ll relax this.","commit_id":"87dac4b7bd09b513620b5f991457564a278d2dd3"},{"author":{"_account_id":14358,"name":"Marian Horban","email":"m.horban@gmail.com","username":"mhorban"},"change_message_id":"e593612b72a083f57ce0592f0a3cf71d618cf592","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"# nova/volume/encryptors/cryptsetup.py:"},{"line_number":220,"context_line":"# nova/volume/encryptors/luks.py:"},{"line_number":221,"context_line":"ln: RegExpFilter, ln, root, ln, --symbolic, --force, /dev/mapper/crypt-.*, .*"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"# nova/volume/encryptors.py:"},{"line_number":224,"context_line":"# nova/virt/libvirt/dmcrypt.py:"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"7a2fa921_da9fec4e","line":221,"updated":"2015-10-12 16:15:07.000000000","message":"Maybe /dev/mapper/crypt-.+ would be better?","commit_id":"e139f57b6ffaa8b37bc0ace64269bd662461f4ed"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"9badb32e0c911a72efe81254ca6653e39e9dd31d","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"# nova/volume/encryptors/cryptsetup.py:"},{"line_number":220,"context_line":"# nova/volume/encryptors/luks.py:"},{"line_number":221,"context_line":"ln: RegExpFilter, ln, root, ln, --symbolic, --force, /dev/mapper/crypt-.*, .*"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"# nova/volume/encryptors.py:"},{"line_number":224,"context_line":"# nova/virt/libvirt/dmcrypt.py:"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"7a740942_801e1f5d","line":221,"in_reply_to":"5a2ca52d_0d76e96f","updated":"2015-12-14 05:59:28.000000000","message":"Done.\n\ncrypt- is always added with this patch. Old names may only be used to removal of encrypted devices.","commit_id":"e139f57b6ffaa8b37bc0ace64269bd662461f4ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6f274f7f647aa7b326b711b78546194f05d05839","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"# nova/volume/encryptors/cryptsetup.py:"},{"line_number":220,"context_line":"# nova/volume/encryptors/luks.py:"},{"line_number":221,"context_line":"ln: RegExpFilter, ln, root, ln, --symbolic, --force, /dev/mapper/crypt-.*, .*"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"# nova/volume/encryptors.py:"},{"line_number":224,"context_line":"# nova/virt/libvirt/dmcrypt.py:"}],"source_content_type":"application/octet-stream","patch_set":8,"id":"5a2ca52d_0d76e96f","line":221,"in_reply_to":"7a2fa921_da9fec4e","updated":"2015-10-16 18:11:59.000000000","message":"crypt is optional here isn\u0027t it? There are the cases where dev_name uses the old name (not prefixed with crypt-) and the wwn fibrechannel case, so this seems wrong.","commit_id":"e139f57b6ffaa8b37bc0ace64269bd662461f4ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ae875c1ac577c2bdb4075919d934fbe007aaba44","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"# nova/volume/encryptors/cryptsetup.py:"},{"line_number":220,"context_line":"# nova/volume/encryptors/luks.py:"},{"line_number":221,"context_line":"ln: RegExpFilter, ln, root, ln, --symbolic, --force, /dev/mapper/crypt-.+, .+"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"# nova/volume/encryptors.py:"},{"line_number":224,"context_line":"# nova/virt/libvirt/dmcrypt.py:"}],"source_content_type":"application/octet-stream","patch_set":10,"id":"1af94dfe_f320f44b","line":221,"range":{"start_line":221,"start_character":65,"end_line":221,"end_character":70},"updated":"2016-03-15 21:02:22.000000000","message":"Wait, if we revert to using the old device name, then we aren\u0027t going to be prefixing with crypt-, so this should probably not change at all.","commit_id":"dec1c900e4099c639ac14c72ad7765821f32b8b5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7a3b62a4920e7ae17dda998ae20b868003a2f4c1","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"# nova/volume/encryptors/cryptsetup.py:"},{"line_number":220,"context_line":"# nova/volume/encryptors/luks.py:"},{"line_number":221,"context_line":"ln: RegExpFilter, ln, root, ln, --symbolic, --force, /dev/mapper/crypt-.+, .+"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"# nova/volume/encryptors.py:"},{"line_number":224,"context_line":"# nova/virt/libvirt/dmcrypt.py:"}],"source_content_type":"application/octet-stream","patch_set":10,"id":"1af94dfe_b1287b34","line":221,"range":{"start_line":221,"start_character":65,"end_line":221,"end_character":70},"in_reply_to":"1af94dfe_5c63b01a","updated":"2016-03-18 15:54:12.000000000","message":"Good point.","commit_id":"dec1c900e4099c639ac14c72ad7765821f32b8b5"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"3f1da7c5d6cdaeb1582bc4f5700c8241fa871134","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"# nova/volume/encryptors/cryptsetup.py:"},{"line_number":220,"context_line":"# nova/volume/encryptors/luks.py:"},{"line_number":221,"context_line":"ln: RegExpFilter, ln, root, ln, --symbolic, --force, /dev/mapper/crypt-.+, .+"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"# nova/volume/encryptors.py:"},{"line_number":224,"context_line":"# nova/virt/libvirt/dmcrypt.py:"}],"source_content_type":"application/octet-stream","patch_set":10,"id":"1af94dfe_5c63b01a","line":221,"range":{"start_line":221,"start_character":65,"end_line":221,"end_character":70},"in_reply_to":"1af94dfe_b3ddcc44","updated":"2016-03-16 03:00:24.000000000","message":"This is called from attach_volume in luks.py and cryptsetup.py.\n\nOld names without \"crypt-\" prefix are only on rolling update with existing encrypted volumes already attached to nova instance.\nOnce the volume is detached (by calling detach_volume) and attached again (by calling attach_volume), the symlink will be recreated with \"crypt-\" prefix.\n\nSo it should be okey to add \"crypt-\" prefix here, which will improbe security in some degree.","commit_id":"dec1c900e4099c639ac14c72ad7765821f32b8b5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"1075fbba34bb1ee7a713f9509d5670fb710194a3","unresolved":false,"context_lines":[{"line_number":218,"context_line":""},{"line_number":219,"context_line":"# nova/volume/encryptors/cryptsetup.py:"},{"line_number":220,"context_line":"# nova/volume/encryptors/luks.py:"},{"line_number":221,"context_line":"ln: RegExpFilter, ln, root, ln, --symbolic, --force, /dev/mapper/crypt-.+, .+"},{"line_number":222,"context_line":""},{"line_number":223,"context_line":"# nova/volume/encryptors.py:"},{"line_number":224,"context_line":"# nova/virt/libvirt/dmcrypt.py:"}],"source_content_type":"application/octet-stream","patch_set":10,"id":"1af94dfe_b3ddcc44","line":221,"range":{"start_line":221,"start_character":65,"end_line":221,"end_character":70},"in_reply_to":"1af94dfe_f320f44b","updated":"2016-03-15 21:03:40.000000000","message":"I made this same comment in patch set 8.","commit_id":"dec1c900e4099c639ac14c72ad7765821f32b8b5"}],"nova/tests/unit/volume/encryptors/test_cryptsetup.py":[{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d513a10bb42e5a3cc5c4e685f84eed98dd68f70c","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        super(CryptsetupEncryptorTestCase, self).setUp()"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        self.dev_path \u003d self.connection_info[\u0027data\u0027][\u0027device_path\u0027]"},{"line_number":43,"context_line":"        self.dev_name \u003d \u0027crypt-%s\u0027 % self.dev_path.split(\u0027/\u0027)[-1]"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.symlink_path \u003d self.dev_path"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_fbf5e0ca","line":43,"updated":"2015-09-15 10:29:46.000000000","message":"I don\u0027t see any tests for the compatibility mode in here, I think we need to have some.","commit_id":"87dac4b7bd09b513620b5f991457564a278d2dd3"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"0ab63aa22ffb8b6512e564a1b2f3be9f619db105","unresolved":false,"context_lines":[{"line_number":40,"context_line":"        super(CryptsetupEncryptorTestCase, self).setUp()"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"        self.dev_path \u003d self.connection_info[\u0027data\u0027][\u0027device_path\u0027]"},{"line_number":43,"context_line":"        self.dev_name \u003d \u0027crypt-%s\u0027 % self.dev_path.split(\u0027/\u0027)[-1]"},{"line_number":44,"context_line":""},{"line_number":45,"context_line":"        self.symlink_path \u003d self.dev_path"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_4b43c542","line":43,"in_reply_to":"ba15a1d1_fbf5e0ca","updated":"2015-09-15 18:14:40.000000000","message":"Will add the unit test.","commit_id":"87dac4b7bd09b513620b5f991457564a278d2dd3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7d7345d77ef9921d5b5383fd9f56805e869fc10f","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # If an old name crypt device exists, dev_path should be the old name."},{"line_number":112,"context_line":"        old_dev_name \u003d self.dev_path.split(\u0027/\u0027)[-1]"},{"line_number":113,"context_line":"        encryptor \u003d cryptsetup.CryptsetupEncryptor(self.connection_info)"},{"line_number":114,"context_line":"        self.assertEqual(old_dev_name, encryptor.dev_name)"},{"line_number":115,"context_line":"        self.assertEqual(self.dev_path, encryptor.dev_path)"},{"line_number":116,"context_line":"        self.assertEqual(self.symlink_path, encryptor.symlink_path)"},{"line_number":117,"context_line":"        mock_exists.assert_called_once_with(\u0027/dev/mapper/%s\u0027 % old_dev_name)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1af94dfe_730504c1","line":114,"range":{"start_line":114,"start_character":8,"end_line":114,"end_character":58},"updated":"2016-03-15 21:01:25.000000000","message":"We should probably also assert that the encryptor.dev_name does not start with \u0027crypt-\u0027.","commit_id":"dec1c900e4099c639ac14c72ad7765821f32b8b5"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"3f1da7c5d6cdaeb1582bc4f5700c8241fa871134","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        # If an old name crypt device exists, dev_path should be the old name."},{"line_number":112,"context_line":"        old_dev_name \u003d self.dev_path.split(\u0027/\u0027)[-1]"},{"line_number":113,"context_line":"        encryptor \u003d cryptsetup.CryptsetupEncryptor(self.connection_info)"},{"line_number":114,"context_line":"        self.assertEqual(old_dev_name, encryptor.dev_name)"},{"line_number":115,"context_line":"        self.assertEqual(self.dev_path, encryptor.dev_path)"},{"line_number":116,"context_line":"        self.assertEqual(self.symlink_path, encryptor.symlink_path)"},{"line_number":117,"context_line":"        mock_exists.assert_called_once_with(\u0027/dev/mapper/%s\u0027 % old_dev_name)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1af94dfe_d7c4bb93","line":114,"range":{"start_line":114,"start_character":8,"end_line":114,"end_character":58},"in_reply_to":"1af94dfe_730504c1","updated":"2016-03-16 03:00:24.000000000","message":"The old_dev_name is specified in this test class, but I will add the check.","commit_id":"dec1c900e4099c639ac14c72ad7765821f32b8b5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8e11db83e2a1ac1a0d9059fd9313036f1660573d","unresolved":false,"context_lines":[{"line_number":133,"context_line":"        self.assertEqual(wwn, encryptor.dev_name)"},{"line_number":134,"context_line":"        self.assertEqual(self.dev_path, encryptor.dev_path)"},{"line_number":135,"context_line":"        self.assertEqual(self.symlink_path, encryptor.symlink_path)"},{"line_number":136,"context_line":"        mock_exists.assert_any_call(\u0027/dev/mapper/%s\u0027 % old_dev_name)"},{"line_number":137,"context_line":"        mock_exists.assert_any_call(\u0027/dev/mapper/%s\u0027 % wwn)"},{"line_number":138,"context_line":"        mock_execute.assert_called_once_with("},{"line_number":139,"context_line":"            \u0027cryptsetup\u0027, \u0027status\u0027, wwn, run_as_root\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":11,"id":"1af94dfe_75409e07","line":136,"range":{"start_line":136,"start_character":20,"end_line":136,"end_character":35},"updated":"2016-03-18 16:10:05.000000000","message":"I\u0027d prefer to see assert_has_calls used so we\u0027re more specific since we should be checking these paths in order.","commit_id":"7e1d8bd5671c33ff96d481a7e46d0fde2f3f718c"}],"nova/volume/encryptors/cryptsetup.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"365565ecd6520b234b006ba2bc4810f2cd2a9336","unresolved":false,"context_lines":[{"line_number":38,"context_line":"        self.symlink_path \u003d connection_info[\u0027data\u0027][\u0027device_path\u0027]"},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        # a unique name for the volume -- e.g., the iSCSI participant name"},{"line_number":41,"context_line":"        self.dev_name \u003d \u0027crypt-%s\u0027 % self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":42,"context_line":"        # the device\u0027s actual path on the compute host -- e.g., /dev/sd_"},{"line_number":43,"context_line":"        self.dev_path \u003d os.path.realpath(self.symlink_path)"},{"line_number":44,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"da20952f_c4faa443","line":41,"updated":"2015-09-09 00:27:50.000000000","message":"So what happens if I\u0027m not using multipath and attached an encrypted volume before this change, then upgrade to this code and then try to detach?  I\u0027m assuming it\u0027s going to fail since the name it\u0027s expecting has changed...so I\u0027d think you\u0027d need to add a check for that or perform some kind of migration code.","commit_id":"6fd3e1e471fa510efeee0f3befe151db981d9058"},{"author":{"_account_id":12924,"name":"Patrick East","email":"east.patrick@gmail.com","username":"patrick.east"},"change_message_id":"3065bfe2333b1d5d39218e901d50d244e0ffebb1","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        self.dev_name \u003d \u0027crypt-%s\u0027 % self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        # NOTE(tsekiyama): In older version of nova, dev_name was the same"},{"line_number":54,"context_line":"        # as the symlink name. In Liberty release, it has \u0027crypt-\u0027 prefix to"},{"line_number":55,"context_line":"        # avoid conflict with multipath device symlink. To enable rolling"},{"line_number":56,"context_line":"        # update, we use the old name when the encrypted volume already exists."},{"line_number":57,"context_line":"        old_dev_name \u003d self.symlink_path.split(\u0027/\u0027)[-1]"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_f865ade0","line":54,"updated":"2015-09-11 00:12:03.000000000","message":"Maybe worth saying \u0027As of the Liberty release\u0027 or maybe even just saying \u0027Newer versions have \u0027crypt-\u0027 prefix...\" since it won\u0027t just be for Liberty.","commit_id":"2ffdae8ebd5c9cb26bc83a434714bc5f84c7a008"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"87c2f9234578ced3c5ca37f2a934aac7179995db","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        self.dev_name \u003d \u0027crypt-%s\u0027 % self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"        # NOTE(tsekiyama): In older version of nova, dev_name was the same"},{"line_number":54,"context_line":"        # as the symlink name. In Liberty release, it has \u0027crypt-\u0027 prefix to"},{"line_number":55,"context_line":"        # avoid conflict with multipath device symlink. To enable rolling"},{"line_number":56,"context_line":"        # update, we use the old name when the encrypted volume already exists."},{"line_number":57,"context_line":"        old_dev_name \u003d self.symlink_path.split(\u0027/\u0027)[-1]"}],"source_content_type":"text/x-python","patch_set":3,"id":"da20952f_b8ebb5a3","line":54,"in_reply_to":"da20952f_f865ade0","updated":"2015-09-11 00:33:52.000000000","message":"Done","commit_id":"2ffdae8ebd5c9cb26bc83a434714bc5f84c7a008"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d513a10bb42e5a3cc5c4e685f84eed98dd68f70c","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        \"\"\"Returns the LUKS device status, or \"\" if the device is unavailable."},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        out, err \u003d utils.execute(\u0027cryptsetup\u0027, \u0027status\u0027, dev_name,"},{"line_number":71,"context_line":"                                 run_as_root\u003dTrue, check_exit_code\u003d[0, 1])"},{"line_number":72,"context_line":"        LOG.debug(\"cryptsetup status: stdout \u003d %s, stderr \u003d %s\", out, err)"},{"line_number":73,"context_line":"        return out"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_9bbf04fb","line":71,"updated":"2015-09-15 10:29:46.000000000","message":"notice on error, this raises an exception:\nhttps://github.com/openstack/nova/blob/master/nova/utils.py#L350\n\nshould we not be catching that here?","commit_id":"87dac4b7bd09b513620b5f991457564a278d2dd3"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"0ab63aa22ffb8b6512e564a1b2f3be9f619db105","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        \"\"\"Returns the LUKS device status, or \"\" if the device is unavailable."},{"line_number":69,"context_line":"        \"\"\""},{"line_number":70,"context_line":"        out, err \u003d utils.execute(\u0027cryptsetup\u0027, \u0027status\u0027, dev_name,"},{"line_number":71,"context_line":"                                 run_as_root\u003dTrue, check_exit_code\u003d[0, 1])"},{"line_number":72,"context_line":"        LOG.debug(\"cryptsetup status: stdout \u003d %s, stderr \u003d %s\", out, err)"},{"line_number":73,"context_line":"        return out"},{"line_number":74,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_a33baf37","line":71,"in_reply_to":"ba15a1d1_9bbf04fb","updated":"2015-09-15 18:14:40.000000000","message":"OK, I\u0027ll add check for the exception and add LOG.warning() instead of relying on check_exit_code.","commit_id":"87dac4b7bd09b513620b5f991457564a278d2dd3"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d513a10bb42e5a3cc5c4e685f84eed98dd68f70c","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        out, err \u003d utils.execute(\u0027cryptsetup\u0027, \u0027status\u0027, dev_name,"},{"line_number":71,"context_line":"                                 run_as_root\u003dTrue, check_exit_code\u003d[0, 1])"},{"line_number":72,"context_line":"        LOG.debug(\"cryptsetup status: stdout \u003d %s, stderr \u003d %s\", out, err)"},{"line_number":73,"context_line":"        return out"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def _get_passphrase(self, key):"},{"line_number":76,"context_line":"        return \u0027\u0027.join(hex(x).replace(\u00270x\u0027, \u0027\u0027) for x in key)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_5b5f2ce5","line":73,"updated":"2015-09-15 10:29:46.000000000","message":"can\u0027t we just return true vs false, so its very clear what is returned? Maybe rename to _is_crypt_device_availalbe or something like that?","commit_id":"87dac4b7bd09b513620b5f991457564a278d2dd3"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"0ab63aa22ffb8b6512e564a1b2f3be9f619db105","unresolved":false,"context_lines":[{"line_number":70,"context_line":"        out, err \u003d utils.execute(\u0027cryptsetup\u0027, \u0027status\u0027, dev_name,"},{"line_number":71,"context_line":"                                 run_as_root\u003dTrue, check_exit_code\u003d[0, 1])"},{"line_number":72,"context_line":"        LOG.debug(\"cryptsetup status: stdout \u003d %s, stderr \u003d %s\", out, err)"},{"line_number":73,"context_line":"        return out"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def _get_passphrase(self, key):"},{"line_number":76,"context_line":"        return \u0027\u0027.join(hex(x).replace(\u00270x\u0027, \u0027\u0027) for x in key)"}],"source_content_type":"text/x-python","patch_set":4,"id":"ba15a1d1_e35a072a","line":73,"in_reply_to":"ba15a1d1_5b5f2ce5","updated":"2015-09-15 18:14:40.000000000","message":"Done","commit_id":"87dac4b7bd09b513620b5f991457564a278d2dd3"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"cb25d0298807dae9fbe7483761edc7e422308dd5","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                volume_type\u003dconnection_info[\u0027driver_volume_type\u0027])"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        # the device\u0027s path as given to libvirt -- e.g., /dev/disk/by-path/..."},{"line_number":50,"context_line":"        self.symlink_path \u003d connection_info[\u0027data\u0027][\u0027device_path\u0027]"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        # a unique name for the volume -- e.g., the iSCSI participant name"},{"line_number":53,"context_line":"        self.dev_name \u003d \u0027crypt-%s\u0027 % self.symlink_path.split(\u0027/\u0027)[-1]"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_68b1e4e0","line":50,"updated":"2015-09-15 22:53:10.000000000","message":"The device path here may or may not be a path based out of /dev/mapper\n\nFC based multipath device paths are described here:\n\nhttps://github.com/openstack/os-brick/commit/3ea86f7d605d7109f4e13c1566ba1a14dc856443#diff-c6b46156e9c833b44659c1e033092cee\n\nWe shouldn\u0027t assume that the existing device path is going to be /dev/mapper/***","commit_id":"c629d1b109b7404b028b42b23c4097d6249b2ca8"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"b812a92adb79bdb1bdba0c707e5aca5b2f79071e","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                volume_type\u003dconnection_info[\u0027driver_volume_type\u0027])"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        # the device\u0027s path as given to libvirt -- e.g., /dev/disk/by-path/..."},{"line_number":50,"context_line":"        self.symlink_path \u003d connection_info[\u0027data\u0027][\u0027device_path\u0027]"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        # a unique name for the volume -- e.g., the iSCSI participant name"},{"line_number":53,"context_line":"        self.dev_name \u003d \u0027crypt-%s\u0027 % self.symlink_path.split(\u0027/\u0027)[-1]"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_6e2a4d2e","line":50,"in_reply_to":"ba15a1d1_0e3cf1c6","updated":"2015-09-15 23:24:04.000000000","message":"This is searching for the encryption device, not original device, which had been always created in (\"/dev/mapper/%s\" % dev_name) before this patch is applied.\n(So this conflicts when original device is placed in /dev/mapper/*, that is why the encryption attach was failing.)\nIt exists only when the encrypted volume is attached before nova-compute is upgraded to the new version with this patch.\n\nTo enable rolling upgrade, we need to check for old name encrypt device, and if it exists, we should continue to use old name device. Otherwise the volume will be undetachable.","commit_id":"c629d1b109b7404b028b42b23c4097d6249b2ca8"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"0310449902cc6d3e212ec970d036f72ac08910a5","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                volume_type\u003dconnection_info[\u0027driver_volume_type\u0027])"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        # the device\u0027s path as given to libvirt -- e.g., /dev/disk/by-path/..."},{"line_number":50,"context_line":"        self.symlink_path \u003d connection_info[\u0027data\u0027][\u0027device_path\u0027]"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        # a unique name for the volume -- e.g., the iSCSI participant name"},{"line_number":53,"context_line":"        self.dev_name \u003d \u0027crypt-%s\u0027 % self.symlink_path.split(\u0027/\u0027)[-1]"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_0e3cf1c6","line":50,"in_reply_to":"ba15a1d1_680d648f","updated":"2015-09-15 23:13:22.000000000","message":"you call _is_crypt_device_available(old_dev_name),\n\nthat looks in /dev/mapper/","commit_id":"c629d1b109b7404b028b42b23c4097d6249b2ca8"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"13ed27a1a577c187db73ca8cda38ca0de0a0b6ad","unresolved":false,"context_lines":[{"line_number":47,"context_line":"                volume_type\u003dconnection_info[\u0027driver_volume_type\u0027])"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"        # the device\u0027s path as given to libvirt -- e.g., /dev/disk/by-path/..."},{"line_number":50,"context_line":"        self.symlink_path \u003d connection_info[\u0027data\u0027][\u0027device_path\u0027]"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"        # a unique name for the volume -- e.g., the iSCSI participant name"},{"line_number":53,"context_line":"        self.dev_name \u003d \u0027crypt-%s\u0027 % self.symlink_path.split(\u0027/\u0027)[-1]"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba15a1d1_680d648f","line":50,"in_reply_to":"ba15a1d1_68b1e4e0","updated":"2015-09-15 23:00:13.000000000","message":"There is no assumption here about device path. This symlink_path will be used as a symlink to the original (non-encrypted) device path.\n\nIt will be replaced with the symlink to the LUKS device path (\"/dev/mapper/crypt-%s\") after the LUKS device is created.","commit_id":"c629d1b109b7404b028b42b23c4097d6249b2ca8"},{"author":{"_account_id":5997,"name":"Walt","display_name":"Hemna","email":"waboring@hemna.com","username":"walter-boring","status":"SAP"},"change_message_id":"9bce8a18be4ec32149d709440eddc115b91450d5","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        # To enable rolling update, we use the old name when the encrypted"},{"line_number":59,"context_line":"        # volume already exists."},{"line_number":60,"context_line":"        old_dev_name \u003d self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":61,"context_line":"        wwn \u003d connection_info.get(\u0027multipath_id\u0027)"},{"line_number":62,"context_line":"        if self._is_crypt_device_available(old_dev_name):"},{"line_number":63,"context_line":"            self.dev_name \u003d old_dev_name"},{"line_number":64,"context_line":"            LOG.debug(\"Using old encrypted volume name: %s\", self.dev_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_fa80fe8c","line":61,"updated":"2015-09-17 15:50:01.000000000","message":"First, the multipath_id is in the data portion of the connection_info.   connection_info[\u0027data\u0027][\u0027multipath_id\u0027]\n\nsecond, multipath_id is ONLY set for FC based devices.   So this won\u0027t work for iSCSI.","commit_id":"f8fdd8b986f6323bd3abb295a784e0843d4d113a"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"095aa7bb579a06f28daafec97263deb629f8bc9f","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        # To enable rolling update, we use the old name when the encrypted"},{"line_number":59,"context_line":"        # volume already exists."},{"line_number":60,"context_line":"        old_dev_name \u003d self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":61,"context_line":"        wwn \u003d connection_info.get(\u0027multipath_id\u0027)"},{"line_number":62,"context_line":"        if self._is_crypt_device_available(old_dev_name):"},{"line_number":63,"context_line":"            self.dev_name \u003d old_dev_name"},{"line_number":64,"context_line":"            LOG.debug(\"Using old encrypted volume name: %s\", self.dev_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba15a1d1_65f1aa6a","line":61,"in_reply_to":"ba15a1d1_fa80fe8c","updated":"2015-09-17 18:43:31.000000000","message":"Fixed: s/connection_info/data/\n\nThanks to catch this.\n\nFor iSCSI case, data.get(\u0027multipath_id\u0027) will return None and is ignored by \"elif wnn and ...\" below.","commit_id":"f8fdd8b986f6323bd3abb295a784e0843d4d113a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6f274f7f647aa7b326b711b78546194f05d05839","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        self.dev_name \u003d \u0027crypt-%s\u0027 % self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        # NOTE(tsekiyama): In older version of nova, dev_name was the same"},{"line_number":56,"context_line":"        # as the symlink name. As of the Liberty release, it has \u0027crypt-\u0027"},{"line_number":57,"context_line":"        # prefix to avoid conflict with multipath device symlink."},{"line_number":58,"context_line":"        # To enable rolling update, we use the old name when the encrypted"},{"line_number":59,"context_line":"        # volume already exists."}],"source_content_type":"text/x-python","patch_set":8,"id":"5a2ca52d_6d22fda4","line":56,"updated":"2015-10-16 18:11:59.000000000","message":"s/Liberty/Mitaka/.\n\nIt\u0027s probably best to just not mention this at all in here in case you plan on backporting this fix to the stable branches.","commit_id":"e139f57b6ffaa8b37bc0ace64269bd662461f4ed"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"9badb32e0c911a72efe81254ca6653e39e9dd31d","unresolved":false,"context_lines":[{"line_number":53,"context_line":"        self.dev_name \u003d \u0027crypt-%s\u0027 % self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        # NOTE(tsekiyama): In older version of nova, dev_name was the same"},{"line_number":56,"context_line":"        # as the symlink name. As of the Liberty release, it has \u0027crypt-\u0027"},{"line_number":57,"context_line":"        # prefix to avoid conflict with multipath device symlink."},{"line_number":58,"context_line":"        # To enable rolling update, we use the old name when the encrypted"},{"line_number":59,"context_line":"        # volume already exists."}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_c0018706","line":56,"in_reply_to":"5a2ca52d_6d22fda4","updated":"2015-12-14 05:59:28.000000000","message":"Done","commit_id":"e139f57b6ffaa8b37bc0ace64269bd662461f4ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c8afabacbacaa14c9d1815d6495d3c12293b93a2","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        # as the symlink name. As of the Liberty release, it has \u0027crypt-\u0027"},{"line_number":57,"context_line":"        # prefix to avoid conflict with multipath device symlink."},{"line_number":58,"context_line":"        # To enable rolling update, we use the old name when the encrypted"},{"line_number":59,"context_line":"        # volume already exists."},{"line_number":60,"context_line":"        old_dev_name \u003d self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":61,"context_line":"        wwn \u003d data.get(\u0027multipath_id\u0027)"},{"line_number":62,"context_line":"        if self._is_crypt_device_available(old_dev_name):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a2ca52d_6dad1d9a","line":59,"updated":"2015-10-16 18:16:54.000000000","message":"This is really just here for the detach case right?  So I\u0027m not using multipath in Liberty, I have an attached encrypted volume, I upgrade to this change and try to detach, it will fail because the device won\u0027t be found by the name with crypt-.\n\nSo isn\u0027t the only condition you really need to handle in the detach case?  For all new attachments, crypt- should be OK.\n\nWhat you\u0027d have to worry about is detaching with a device that doesn\u0027t exist with the crypt- name, so at that point you\u0027d need to fallback to doing your alternative name backward compat checking.","commit_id":"e139f57b6ffaa8b37bc0ace64269bd662461f4ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a8c363dcfd6654f9923fc5a92288e19a510ab1c2","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        # as the symlink name. As of the Liberty release, it has \u0027crypt-\u0027"},{"line_number":57,"context_line":"        # prefix to avoid conflict with multipath device symlink."},{"line_number":58,"context_line":"        # To enable rolling update, we use the old name when the encrypted"},{"line_number":59,"context_line":"        # volume already exists."},{"line_number":60,"context_line":"        old_dev_name \u003d self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":61,"context_line":"        wwn \u003d data.get(\u0027multipath_id\u0027)"},{"line_number":62,"context_line":"        if self._is_crypt_device_available(old_dev_name):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a2ca52d_8d2e79f9","line":59,"in_reply_to":"5a2ca52d_6dad1d9a","updated":"2015-10-16 18:19:33.000000000","message":"Then again maybe it\u0027s preferable to do it here so it\u0027s covered for both the cryptsetup and luks case, since the luks encryptor extends this class.","commit_id":"e139f57b6ffaa8b37bc0ace64269bd662461f4ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6f274f7f647aa7b326b711b78546194f05d05839","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            utils.execute(\u0027cryptsetup\u0027, \u0027status\u0027, dev_name, run_as_root\u003dTrue)"},{"line_number":81,"context_line":"        except processutils.ProcessExecutionError as e:"},{"line_number":82,"context_line":"            # If /dev/mapper/\u003cdev_name\u003e is a multipath device, exit_code is 1."},{"line_number":83,"context_line":"            if e.exit_code is not 1:"},{"line_number":84,"context_line":"                LOG.warning(_LW(\"cryptsetup status exited abnormally \""},{"line_number":85,"context_line":"                                \"(status %(exit_code)s): %(stderr)s\"),"},{"line_number":86,"context_line":"                            {\"exit_code\": e.exit_code, \"stderr\": e.stderr})"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a2ca52d_ad7a5586","line":83,"updated":"2015-10-16 18:11:59.000000000","message":"nit: I\u0027d use !\u003d 1 here.","commit_id":"e139f57b6ffaa8b37bc0ace64269bd662461f4ed"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"9badb32e0c911a72efe81254ca6653e39e9dd31d","unresolved":false,"context_lines":[{"line_number":80,"context_line":"            utils.execute(\u0027cryptsetup\u0027, \u0027status\u0027, dev_name, run_as_root\u003dTrue)"},{"line_number":81,"context_line":"        except processutils.ProcessExecutionError as e:"},{"line_number":82,"context_line":"            # If /dev/mapper/\u003cdev_name\u003e is a multipath device, exit_code is 1."},{"line_number":83,"context_line":"            if e.exit_code is not 1:"},{"line_number":84,"context_line":"                LOG.warning(_LW(\"cryptsetup status exited abnormally \""},{"line_number":85,"context_line":"                                \"(status %(exit_code)s): %(stderr)s\"),"},{"line_number":86,"context_line":"                            {\"exit_code\": e.exit_code, \"stderr\": e.stderr})"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_e004c315","line":83,"in_reply_to":"5a2ca52d_ad7a5586","updated":"2015-12-14 05:59:28.000000000","message":"Done","commit_id":"e139f57b6ffaa8b37bc0ace64269bd662461f4ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6f274f7f647aa7b326b711b78546194f05d05839","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        except processutils.ProcessExecutionError as e:"},{"line_number":82,"context_line":"            # If /dev/mapper/\u003cdev_name\u003e is a multipath device, exit_code is 1."},{"line_number":83,"context_line":"            if e.exit_code is not 1:"},{"line_number":84,"context_line":"                LOG.warning(_LW(\"cryptsetup status exited abnormally \""},{"line_number":85,"context_line":"                                \"(status %(exit_code)s): %(stderr)s\"),"},{"line_number":86,"context_line":"                            {\"exit_code\": e.exit_code, \"stderr\": e.stderr})"},{"line_number":87,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":8,"id":"5a2ca52d_ed5ccd1a","line":84,"updated":"2015-10-16 18:11:59.000000000","message":"You might want to include the dev_name argument here.","commit_id":"e139f57b6ffaa8b37bc0ace64269bd662461f4ed"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"9badb32e0c911a72efe81254ca6653e39e9dd31d","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        except processutils.ProcessExecutionError as e:"},{"line_number":82,"context_line":"            # If /dev/mapper/\u003cdev_name\u003e is a multipath device, exit_code is 1."},{"line_number":83,"context_line":"            if e.exit_code is not 1:"},{"line_number":84,"context_line":"                LOG.warning(_LW(\"cryptsetup status exited abnormally \""},{"line_number":85,"context_line":"                                \"(status %(exit_code)s): %(stderr)s\"),"},{"line_number":86,"context_line":"                            {\"exit_code\": e.exit_code, \"stderr\": e.stderr})"},{"line_number":87,"context_line":"            return False"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a740942_a00a3b1e","line":84,"in_reply_to":"5a2ca52d_ed5ccd1a","updated":"2015-12-14 05:59:28.000000000","message":"Done","commit_id":"e139f57b6ffaa8b37bc0ace64269bd662461f4ed"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7d7345d77ef9921d5b5383fd9f56805e869fc10f","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        if self._is_crypt_device_available(old_dev_name):"},{"line_number":62,"context_line":"            self.dev_name \u003d old_dev_name"},{"line_number":63,"context_line":"            LOG.debug(\"Using old encrypted volume name: %s\", self.dev_name)"},{"line_number":64,"context_line":"        elif wwn and wwn is not old_dev_name:"},{"line_number":65,"context_line":"            # FibreChannel device could be named \u0027/dev/mapper/\u003cWWN\u003e\u0027."},{"line_number":66,"context_line":"            if self._is_crypt_device_available(wwn):"},{"line_number":67,"context_line":"                self.dev_name \u003d wwn"}],"source_content_type":"text/x-python","patch_set":10,"id":"1af94dfe_53d56841","line":64,"range":{"start_line":64,"start_character":25,"end_line":64,"end_character":31},"updated":"2016-03-15 21:01:25.000000000","message":"nit: please use !\u003d since we\u0027re checking the value, not the identity.","commit_id":"dec1c900e4099c639ac14c72ad7765821f32b8b5"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"3f1da7c5d6cdaeb1582bc4f5700c8241fa871134","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        if self._is_crypt_device_available(old_dev_name):"},{"line_number":62,"context_line":"            self.dev_name \u003d old_dev_name"},{"line_number":63,"context_line":"            LOG.debug(\"Using old encrypted volume name: %s\", self.dev_name)"},{"line_number":64,"context_line":"        elif wwn and wwn is not old_dev_name:"},{"line_number":65,"context_line":"            # FibreChannel device could be named \u0027/dev/mapper/\u003cWWN\u003e\u0027."},{"line_number":66,"context_line":"            if self._is_crypt_device_available(wwn):"},{"line_number":67,"context_line":"                self.dev_name \u003d wwn"}],"source_content_type":"text/x-python","patch_set":10,"id":"1af94dfe_17bf43fc","line":64,"range":{"start_line":64,"start_character":25,"end_line":64,"end_character":31},"in_reply_to":"1af94dfe_53d56841","updated":"2016-03-16 03:00:24.000000000","message":"Done","commit_id":"dec1c900e4099c639ac14c72ad7765821f32b8b5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7d7345d77ef9921d5b5383fd9f56805e869fc10f","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        if self._is_crypt_device_available(old_dev_name):"},{"line_number":62,"context_line":"            self.dev_name \u003d old_dev_name"},{"line_number":63,"context_line":"            LOG.debug(\"Using old encrypted volume name: %s\", self.dev_name)"},{"line_number":64,"context_line":"        elif wwn and wwn is not old_dev_name:"},{"line_number":65,"context_line":"            # FibreChannel device could be named \u0027/dev/mapper/\u003cWWN\u003e\u0027."},{"line_number":66,"context_line":"            if self._is_crypt_device_available(wwn):"},{"line_number":67,"context_line":"                self.dev_name \u003d wwn"},{"line_number":68,"context_line":"                LOG.debug(\"Using encrypted volume name from wwn: %s\","},{"line_number":69,"context_line":"                          self.dev_name)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        # the device\u0027s actual path on the compute host -- e.g., /dev/sd_"},{"line_number":72,"context_line":"        self.dev_path \u003d os.path.realpath(self.symlink_path)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1af94dfe_530a88d3","line":69,"range":{"start_line":64,"start_character":8,"end_line":69,"end_character":40},"updated":"2016-03-15 21:01:25.000000000","message":"You don\u0027t have a test for any of this wwn / multipath logic.","commit_id":"dec1c900e4099c639ac14c72ad7765821f32b8b5"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"3f1da7c5d6cdaeb1582bc4f5700c8241fa871134","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        if self._is_crypt_device_available(old_dev_name):"},{"line_number":62,"context_line":"            self.dev_name \u003d old_dev_name"},{"line_number":63,"context_line":"            LOG.debug(\"Using old encrypted volume name: %s\", self.dev_name)"},{"line_number":64,"context_line":"        elif wwn and wwn is not old_dev_name:"},{"line_number":65,"context_line":"            # FibreChannel device could be named \u0027/dev/mapper/\u003cWWN\u003e\u0027."},{"line_number":66,"context_line":"            if self._is_crypt_device_available(wwn):"},{"line_number":67,"context_line":"                self.dev_name \u003d wwn"},{"line_number":68,"context_line":"                LOG.debug(\"Using encrypted volume name from wwn: %s\","},{"line_number":69,"context_line":"                          self.dev_name)"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        # the device\u0027s actual path on the compute host -- e.g., /dev/sd_"},{"line_number":72,"context_line":"        self.dev_path \u003d os.path.realpath(self.symlink_path)"}],"source_content_type":"text/x-python","patch_set":10,"id":"1af94dfe_f74617be","line":69,"range":{"start_line":64,"start_character":8,"end_line":69,"end_character":40},"in_reply_to":"1af94dfe_530a88d3","updated":"2016-03-16 03:00:24.000000000","message":"Will add the test.","commit_id":"dec1c900e4099c639ac14c72ad7765821f32b8b5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8e11db83e2a1ac1a0d9059fd9313036f1660573d","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        # old name when the encrypted volume already exists."},{"line_number":59,"context_line":"        old_dev_name \u003d self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":60,"context_line":"        wwn \u003d data.get(\u0027multipath_id\u0027)"},{"line_number":61,"context_line":"        if self._is_crypt_device_available(old_dev_name):"},{"line_number":62,"context_line":"            self.dev_name \u003d old_dev_name"},{"line_number":63,"context_line":"            LOG.debug(\"Using old encrypted volume name: %s\", self.dev_name)"},{"line_number":64,"context_line":"        elif wwn and wwn !\u003d old_dev_name:"}],"source_content_type":"text/x-python","patch_set":11,"id":"1af94dfe_b544e649","line":61,"range":{"start_line":61,"start_character":8,"end_line":61,"end_character":57},"updated":"2016-03-18 16:10:05.000000000","message":"So the thinking here is, with a previously attached volume with the old name, this should return true and we\u0027ll use the old dev name for a detach (since you can\u0027t attach again since it\u0027s already attached).\n\nThen if we try to attach this again, this method will return False because the path doesn\u0027t exist, since we detached it already. In which case we\u0027re going to use the new name to attach.","commit_id":"7e1d8bd5671c33ff96d481a7e46d0fde2f3f718c"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"dfd4d3a5c0b7b121321c363f753b61b92d13a3ac","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        # old name when the encrypted volume already exists."},{"line_number":59,"context_line":"        old_dev_name \u003d self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":60,"context_line":"        wwn \u003d data.get(\u0027multipath_id\u0027)"},{"line_number":61,"context_line":"        if self._is_crypt_device_available(old_dev_name):"},{"line_number":62,"context_line":"            self.dev_name \u003d old_dev_name"},{"line_number":63,"context_line":"            LOG.debug(\"Using old encrypted volume name: %s\", self.dev_name)"},{"line_number":64,"context_line":"        elif wwn and wwn !\u003d old_dev_name:"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa0719c6_e8345ffc","line":61,"range":{"start_line":61,"start_character":8,"end_line":61,"end_character":57},"in_reply_to":"1af94dfe_b544e649","updated":"2016-03-22 05:53:08.000000000","message":"Right, that is the expected behavior to upgrade nova smoothly.","commit_id":"7e1d8bd5671c33ff96d481a7e46d0fde2f3f718c"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8e11db83e2a1ac1a0d9059fd9313036f1660573d","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        try:"},{"line_number":79,"context_line":"            utils.execute(\u0027cryptsetup\u0027, \u0027status\u0027, dev_name, run_as_root\u003dTrue)"},{"line_number":80,"context_line":"        except processutils.ProcessExecutionError as e:"},{"line_number":81,"context_line":"            # If /dev/mapper/\u003cdev_name\u003e is a multipath device, exit_code is 1."},{"line_number":82,"context_line":"            if e.exit_code !\u003d 1:"},{"line_number":83,"context_line":"                LOG.warning(_LW(\u0027cryptsetup status %(dev_name) exited \u0027"},{"line_number":84,"context_line":"                                \u0027abnormally (status %(exit_code)s): %(err)s\u0027),"}],"source_content_type":"text/x-python","patch_set":11,"id":"1af94dfe_31f74b5a","line":81,"range":{"start_line":81,"start_character":12,"end_line":81,"end_character":78},"updated":"2016-03-18 16:10:05.000000000","message":"Hmm, so, we could be a bit more strict about this.\n\nFor example, we can pass check_exit_code\u003d[0, 1] to utils.execute so that it won\u0027t raise ProcessExecutionError if the return code is 0 or 1. But we\u0027d only do that in the case that we\u0027re checking a multipath device, and you should know that from the caller (the wwn case above).\n\nWhat I\u0027m trying to avoid is the non-multipath case failing with exit code 1 and us saying the crypt device is available.","commit_id":"7e1d8bd5671c33ff96d481a7e46d0fde2f3f718c"},{"author":{"_account_id":9176,"name":"Tomoki Sekiyama","email":"tomoki.sekiyama@gmail.com","username":"tsekiyama"},"change_message_id":"dfd4d3a5c0b7b121321c363f753b61b92d13a3ac","unresolved":false,"context_lines":[{"line_number":78,"context_line":"        try:"},{"line_number":79,"context_line":"            utils.execute(\u0027cryptsetup\u0027, \u0027status\u0027, dev_name, run_as_root\u003dTrue)"},{"line_number":80,"context_line":"        except processutils.ProcessExecutionError as e:"},{"line_number":81,"context_line":"            # If /dev/mapper/\u003cdev_name\u003e is a multipath device, exit_code is 1."},{"line_number":82,"context_line":"            if e.exit_code !\u003d 1:"},{"line_number":83,"context_line":"                LOG.warning(_LW(\u0027cryptsetup status %(dev_name) exited \u0027"},{"line_number":84,"context_line":"                                \u0027abnormally (status %(exit_code)s): %(err)s\u0027),"}],"source_content_type":"text/x-python","patch_set":11,"id":"fa0719c6_b6c4885f","line":81,"range":{"start_line":81,"start_character":12,"end_line":81,"end_character":78},"in_reply_to":"1af94dfe_31f74b5a","updated":"2016-03-22 05:53:08.000000000","message":"Ah, the comment above was misleading.\nThe if-clause below is just for skipping the warning message.\nThis does and should return False when cryptsetup exits with 1, regardless of whether the device is multipath or not.\n\nI\u0027ll modify the comment above to:\n\n  # If /dev/mapper/\u003cdev_name\u003e is a non-crypt block device\n  # (such as a disk or a multipath device), the exit_code\n  # will be 1. In that case, we skip the warning.","commit_id":"7e1d8bd5671c33ff96d481a7e46d0fde2f3f718c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1f95f7b3d87a4335c8d02b930ec952b1174deda7","unresolved":false,"context_lines":[{"line_number":57,"context_line":"        # as the symlink name. Now it has \u0027crypt-\u0027 prefix to avoid conflict"},{"line_number":58,"context_line":"        # with multipath device symlink. To enable rolling update, we use the"},{"line_number":59,"context_line":"        # old name when the encrypted volume already exists."},{"line_number":60,"context_line":"        old_dev_name \u003d self.symlink_path.split(\u0027/\u0027)[-1]"},{"line_number":61,"context_line":"        wwn \u003d data.get(\u0027multipath_id\u0027)"},{"line_number":62,"context_line":"        if self._is_crypt_device_available(old_dev_name):"},{"line_number":63,"context_line":"            self.dev_name \u003d old_dev_name"}],"source_content_type":"text/x-python","patch_set":13,"id":"1aa78d24_6c831c05","line":60,"updated":"2016-07-05 21:17:57.000000000","message":"Instead of repeating the split(\u0027/\u0027)[-1] thing here, you could just put this line before line 54 and then make line 54 be simpler:\n\n self.dev_name \u003d \u0027crypt-\u0027 + old_dev_name","commit_id":"89a61ab8f4602e018763afb173e1a862f151a222"}]}
