+ def isMounted_anymp(self, devpath):
+ try:
+ mounts = open('/proc/mounts', 'r').readlines()
+ for x in mounts:
+ if not x.startswith('/'):
+ continue
+ _devPart, _mountpoint = x.split()[:2]
+ if devPart == _devPart:
+ return True
+ except:
+ pass
+ return False
+
+ # check partition ID in extended or swap.
+ def checkSwapExtended(self, partition):
+ partID_Extended = ("5", "0f", "85", "c5", "d5")
+ partID_swap = ("82", "42")
+ data = os.popen("fdisk -l /dev/%s |grep %s" % (partition[:-1], partition )).readline().split()
+ if data[1] == '*':
+ partID = str(data[5])
+ else:
+ partID = str(data[4])
+# print "partID: " ,partID
+# print "checkIDS : ", partID_Extended + partID_swap
+ if partID in partID_Extended + partID_swap:
+ return True
+ else:
+ return False
+