From 922e95092ffa4b65c126bb0254778595e8be1e7b Mon Sep 17 00:00:00 2001 From: Gui Chen Date: Tue, 4 Mar 2014 01:33:06 -0500 Subject: [PATCH] sleep earlier to prepare loop device creation Fixes: #1646 Change-Id: If8e4fbe27e9320abf203eca82de6666271b00f86 Signed-off-by: Gui Chen --- mic/utils/partitionedfs.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/mic/utils/partitionedfs.py b/mic/utils/partitionedfs.py index 8677c89..d0aa652 100644 --- a/mic/utils/partitionedfs.py +++ b/mic/utils/partitionedfs.py @@ -461,6 +461,10 @@ class PartitionedMount(Mount): raise MountError("Failed to map partitions for '%s'" % d['disk'].device) + # FIXME: need a better way to fix the latency + import time + time.sleep(1) + if not os.path.exists(mapperdev): # load mapper device if not updated runner.quiet([self.dmsetup, "mknodes"]) @@ -470,9 +474,6 @@ class PartitionedMount(Mount): raise MountError("Failed to load mapper devices for '%s'" % d['disk'].device) - # FIXME: need a better way to fix the latency - import time - time.sleep(1) d['mapped'] = True def __unmap_partitions(self): -- 2.7.4