Browse code

Fixed pattern matching in clean chroot logic

Change-Id: I4b7853178f1d801614b0fd5070442828668fcb85
Reviewed-on: http://photon-jenkins.eng.vmware.com:8082/3328
Tested-by: gerrit-photon <photon-checkins@vmware.com>
Reviewed-by: Anish Swaminathan <anishs@vmware.com>

dthaluru authored on 2017/07/25 02:10:54
Showing 1 changed files
... ...
@@ -47,7 +47,9 @@ def unmountmountpoints(listmountpoints):
47 47
     return True
48 48
 
49 49
 def findmountpoints(chrootPath):
50
-    cmd="mount | grep -w "+chrootPath+" | cut -d' ' -s -f3"
50
+    if not chrootPath.endswith("/"):
51
+        chrootPath = chrootPath + "/"
52
+    cmd="mount | grep "+chrootPath+" | cut -d' ' -s -f3"
51 53
     process = subprocess.Popen("%s" %cmd,shell=True,stdout=subprocess.PIPE,stderr=subprocess.PIPE)
52 54
     retval = process.wait()
53 55
     if retval!=0: