]> git.apps.os.sepia.ceph.com Git - ceph-ci.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)
committerGuillaume Abrioux <gabrioux@ibm.com>
Wed, 19 Jun 2024 15:06:33 +0000 (17:06 +0200)
commit607eb34b2c278566c386efcbf3018629cf08ccfd
tree8676cf6c6e49213392a8fc2b5991799f16713ee5
parent73b599d3c5e3d95ec74e6b5ea0727340fef049b9
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>
src/ceph-volume/ceph_volume/tests/util/test_encryption.py
src/ceph-volume/ceph_volume/util/encryption.py