]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
ceph-volume: fix regex usage in `set_dmcrypt_no_workqueue` 55336/head
authorGuillaume Abrioux <gabrioux@ibm.com>
Wed, 19 Jun 2024 13:06:52 +0000 (15:06 +0200)
committerGuillaume Abrioux <gabrioux@ibm.com>
Tue, 10 Sep 2024 20:07:12 +0000 (20:07 +0000)
commitc9458ca57a73ca6fbbf4c4c0d8bf171a4e72835f
treec50144b3fca61b346ab3ec25e9f3ce8336af44e6
parentf3495d4e3e3f3f64c8aa6b4c89cc56779ac0df99
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