]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-volume tests catch improper parsing of osd uuid
authorAlfredo Deza <adeza@redhat.com>
Mon, 11 Sep 2017 16:30:34 +0000 (12:30 -0400)
committerAlfredo Deza <adeza@redhat.com>
Mon, 11 Sep 2017 19:26:18 +0000 (15:26 -0400)
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 <adeza@redhat.com>
(cherry picked from commit 5392697121ef150f0edac05df14d116cf0148593)

src/ceph-volume/ceph_volume/tests/devices/lvm/test_trigger.py

index f1dff2d32dd6c7d66629521d7dfbe43169bf15d6..b5280f931bfdb3b30c184e57cdc809d65b1047b9 100644 (file)
@@ -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'
+