From: Kefu Chai Date: Sat, 7 Oct 2017 14:15:11 +0000 (+0800) Subject: ceph-disk: retry on OSError X-Git-Tag: v13.0.1~632^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=4f82dfb9e761a09484e6ba3bd027da535162783e;p=ceph-ci.git ceph-disk: retry on OSError 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 --- diff --git a/src/ceph-disk/ceph_disk/main.py b/src/ceph-disk/ceph_disk/main.py index a9eecc62b9e..1f2101742f7 100644 --- a/src/ceph-disk/ceph_disk/main.py +++ b/src/ceph-disk/ceph_disk/main.py @@ -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