]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: fix regex usage in `set_dmcrypt_no_workqueue`
authorGuillaume Abrioux <gabrioux@ibm.com>
Wed, 19 Jun 2024 13:06:52 +0000 (15:06 +0200)
committerYuri Weinstein <yweinste@redhat.com>
Mon, 14 Apr 2025 19:29:16 +0000 (19:29 +0000)
commit233bf4505d5ae187372f7b16e0f9b8730a8e6b63
tree01d26aafa609eca8d68be1a4d642de19115afd8c
parenta5b0e13f9c96f3b45f596a95ad098f51ca0ccce1
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 69e5789f4ac81d79393fcd8fcc0f65578c518c43)
src/ceph-volume/ceph_volume/tests/util/test_encryption.py
src/ceph-volume/ceph_volume/util/encryption.py