Currently,when mount a device to a mountpoint,it doesn't check if
the mountpoint exist,this will cause mount failure.
Now check the mountpoint before mount,if it doesn't exist,make the
dir of the mountpoint.

Signed-off-by: Mike Qiu <[email protected]>
---
 client/partition.py |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)

diff --git a/client/partition.py b/client/partition.py
index d9c8e30..45d4658 100644
--- a/client/partition.py
+++ b/client/partition.py
@@ -702,6 +702,8 @@ class partition(object):
         # We have to get an exclusive lock here - mount/umount are racy
         fcntl.flock(mtab.fileno(), fcntl.LOCK_EX)
         sys.stdout.flush()
+        if not os.path.isdir(mountpoint):
+            os.makedirs(mountpoint)
         try:
             utils.system(mount_cmd)
             mtab.close()
-- 
1.7.7.6

_______________________________________________
Autotest-kernel mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/autotest-kernel

Reply via email to