]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: fix regex usage in `set_dmcrypt_no_workqueue` 58151/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Wed, 19 Jun 2024 13:06:52 +0000 (15:06 +0200)
committerGuillaume Abrioux <gabrioux@redhat.com>
Thu, 20 Jun 2024 07:30:01 +0000 (07:30 +0000)
commitd49b2888486623415a038630da54f5e1c99f1c63
tree89889efc5387c4d46f884a20e3b4c0faf188c200
parent05ea72c70e06cc70f74b459c399c43f0a8863986
ceph-volume: fix regex usage in `set_dmcrypt_no_workqueue`

- Updated the regex pattern to `r'(\d+\.?)+'` to more accurately
  capture version numbers.

- Replaced `re.match` with `re.search` to properly match the cryptsetup
  version in the output.

- `re.match` only checks for a match at the beginning of the string,
   while `re.search` looks for a match anywhere in the string.

This fix ensures that the function correctly retrieves the
cryptsetup version from the output.

Fixes: https://tracker.ceph.com/issues/66393
Signed-off-by: Guillaume Abrioux <gabrioux@ibm.com>
(cherry picked from commit 607eb34b2c278566c386efcbf3018629cf08ccfd)
src/ceph-volume/ceph_volume/tests/util/test_encryption.py
src/ceph-volume/ceph_volume/util/encryption.py