def check_partitions(self, root_part, filter_func=None): """ Compare the contents of /proc/partitions with those of /proc/mounts and raise exception in case unmounted partitions are found root_part: in Linux /proc/mounts will never directly mention the root partition as being mounted on / instead it will say that /dev/root is mounted on /. Thus require this argument to filter out the root_part from the ones checked to be mounted filter_func: unnary predicate for additional filtering out of partitions required to be mounted Raise: error.AutoservHostError if unfiltered unmounted partition found """ print 'Checking if non-swap partitions are mounted...' unmounted = partition.get_unmounted_partition_list(root_part, filter_func=filter_func, open_func=self.get_open_func()) if unmounted: raise error.AutoservNotMountedHostError( 'Found unmounted partitions: %s' % [part.device for part in unmounted])