- for line in lines:
- parts = line.strip().split(" ")
- if path.realpath(parts[0]).startswith(self.dev_path):
- cmd = ' ' . join([cmd, parts[1]])
+ for line in lines:
+ parts = line.strip().split(" ")
+ real_path = path.realpath(parts[0])
+ if not real_path[-1].isdigit():
+ continue
+ try:
+ if MajorMinor(real_path) == MajorMinor(self.partitionPath(real_path[-1])):
+ cmd = ' ' . join([cmd, parts[1]])
+ break
+ except OSError:
+ pass