]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph-disk: retry on OSError 18189/head
authorKefu Chai <kchai@redhat.com>
Sat, 7 Oct 2017 14:15:11 +0000 (22:15 +0800)
committerKefu Chai <kchai@redhat.com>
Mon, 9 Oct 2017 12:13:26 +0000 (20:13 +0800)
we are likely to
1) create partition, for instance, sdc1
2) partprobe sdc
3) udevadm settle
4) check the device by its path: /dev/sdc1

but there is chance that the uevent sent from kernel fails to reach udev
before we call "udevadm", hence "/dev/sdc1" does not exist even after
"udevadm settle" returns. so we retry in case of OSError here.

Signed-off-by: Kefu Chai <kchai@redhat.com>
(cherry picked from commit 4f82dfb9e761a09484e6ba3bd027da535162783e)

src/ceph-disk/ceph_disk/main.py

index ec05c9bc90e54e423e9eba1c3dc4e0279d7a60ba..0ad3f1afd1c28ce19211963e0119eea290f3ea9e 100755 (executable)
@@ -1845,6 +1845,7 @@ class DevicePartition(object):
         return self.ptype_map[name]['ready']
 
     @staticmethod
+    @retry(OSError)
     def factory(path, dev, args):
         dmcrypt_type = CryptHelpers.get_dmcrypt_type(args)
         if ((path is not None and is_mpath(path)) or