Builds a dict with information to connect to Clusters.

        Parses the list of configuration dictionaries passed by the user and
        builds an internal dict (_clusters) that holds information for creating
        Clients connecting to Clusters and matching database names.

        Args:
            config: A list of dictionaries containing connecting and
                identification information about Clusters.
                A dict has the following structure:
                {label: {host, port, read_preference, dbpath}}.

        Raises:
            Exception('No configuration provided'): no configuration provided.

def _parse_configs(self, config):
        """Builds a dict with information to connect to Clusters.

        Parses the list of configuration dictionaries passed by the user and
        builds an internal dict (_clusters) that holds information for creating
        Clients connecting to Clusters and matching database names.

        Args:
            config: A list of dictionaries containing connecting and
                identification information about Clusters.
                A dict has the following structure:
                {label: {host, port, read_preference, dbpath}}.

        Raises:
            Exception('No configuration provided'): no configuration provided.
        """
        for config_dict in config:
            label = config_dict.keys()[0]
            cfg = config_dict[label]
            # Transform dbpath to something digestable by regexp.
            dbpath = cfg['dbpath']
            pattern = self._parse_dbpath(dbpath)

            read_preference = cfg.get('read_preference', 'primary').upper()
            read_preference = self._get_read_preference(read_preference)

            # Put all parameters that could be passed to pymongo.MongoClient
            # in a separate dict, to ease MongoClient creation.
            cluster_config = {
                'params': {
                    'host': cfg['host'],
                    'port': cfg['port'],
                    'read_preference': read_preference,
                    'replicaSet': cfg.get('replicaSet')
                },
                'pattern': pattern,
                'label': label
            }

            self._clusters.append(cluster_config)