Converts read_preference from string to pymongo.ReadPreference value.

            Args:
                read_preference: string containig the read_preference from the
                    config file
            Returns:
                A value from the pymongo.ReadPreference enum

            Raises:
                Exception: Invalid read preference

def _get_read_preference(read_preference):
        """Converts read_preference from string to pymongo.ReadPreference value.

            Args:
                read_preference: string containig the read_preference from the
                    config file
            Returns:
                A value from the pymongo.ReadPreference enum

            Raises:
                Exception: Invalid read preference"""
        read_preference = getattr(pymongo.ReadPreference, read_preference, None)
        if read_preference is None:
            raise ValueError('Invalid read preference: %s' % read_preference)
        return read_preference