# Path: mongoctl/mongoctl_logging.py
# def log_info(msg):
#     get_logger().info(msg)
# 
# Path: mongoctl/utils.py
# def document_pretty_string(document):
#     return json.dumps(document, indent=4, default=json_util.default)


import mongoctl.repository as repository
import time
from cluster import Cluster
from server import Server
from replicaset_cluster import ReplicaSetCluster
from base import DocumentWrapper
from bson import DBRef
from mongoctl.mongoctl_logging import log_info
from mongoctl.utils import document_pretty_string

        # check if its a config replica
        if isinstance(config_refs, DBRef):
            config_cluster_id = config_refs.id
            return repository.lookup_cluster(config_cluster_id)
        elif isinstance(config_refs, list):
            config_servers = []
            for ref in config_refs:
                config_servers.append(repository.lookup_server(ref["server"].id))

            return config_servers
        else:
            raise Exception("Invalid configServers value")

    ###########################################################################
    def _resolve_shard_members(self):
        member_documents = self.get_property("shards")
        members = []

        # if members are not set then return
        if member_documents:
            for mem_doc in member_documents:
                member = ShardedClusterMember(mem_doc)
                members.append(member)

        return members

    ###########################################################################
    @property
    def config_servers(self):

# Path: mongoctl/mongoctl_logging.py
# def log_info(msg):
#     get_logger().info(msg)
# 
# Path: mongoctl/utils.py
# def document_pretty_string(document):
#     return json.dumps(document, indent=4, default=json_util.default)


# Path: mongoctl/objects/sharded_cluster.py
import mongoctl.repository as repository
import time
from cluster import Cluster
from server import Server
from replicaset_cluster import ReplicaSetCluster
from base import DocumentWrapper
from bson import DBRef
from mongoctl.mongoctl_logging import log_info
from mongoctl.utils import document_pretty_string


        # check if its a config replica
        if isinstance(config_refs, DBRef):
            config_cluster_id = config_refs.id
            return repository.lookup_cluster(config_cluster_id)
        elif isinstance(config_refs, list):
            config_servers = []
            for ref in config_refs:
                config_servers.append(repository.lookup_server(ref["server"].id))

            return config_servers
        else:
            raise Exception("Invalid configServers value")

    ###########################################################################
    def _resolve_shard_members(self):
        member_documents = self.get_property("shards")
        members = []

        # if members are not set then return
        if member_documents:
            for mem_doc in member_documents:
                member = ShardedClusterMember(mem_doc)
                members.append(member)

        return members

    ###########################################################################
    @property
    def config_servers(self):

        if not self._config_servers: