From: Alfredo Deza Date: Mon, 11 Sep 2017 16:30:34 +0000 (-0400) Subject: ceph-volume tests catch improper parsing of osd uuid X-Git-Tag: v12.2.1~45^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=7cdf1772d69e85646a55202c4faac1d0aaace5c4;p=ceph.git ceph-volume tests catch improper parsing of osd uuid When the osd ID existed in the UUID in the same format (e.g. '1-') the parsing would break returning a bogus UUID that is impossible to find Signed-off-by: Alfredo Deza (cherry picked from commit 5392697121ef150f0edac05df14d116cf0148593) --- diff --git a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_trigger.py b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_trigger.py index f1dff2d32dd6..b5280f931bfd 100644 --- a/src/ceph-volume/ceph_volume/tests/devices/lvm/test_trigger.py +++ b/src/ceph-volume/ceph_volume/tests/devices/lvm/test_trigger.py @@ -36,4 +36,10 @@ class TestParseOSDUUID(object): with pytest.raises(exceptions.SuffixParsingError): trigger.parse_osd_uuid('ljahs-dfa-slkjhdfa-foo') + def test_robust_double_id_in_uuid(self): + # it is possible to have the id in the SHA1, this should + # be fine parsing that + result = trigger.parse_osd_uuid("1-abc959fd-1ec9-4864-b141-3154f9b9f8ed") + assert result == 'abc959fd-1ec9-4864-b141-3154f9b9f8ed' +