def get_mongo_uri_template(self, db=None):

        auth = self.is_auth()
        if not db:
            if auth:
                db = "[/<dbname>]"
            else:
                db = ""
        else:
            db = "/" + db

        server_uri_templates = []
        for server in self.get_servers():
            if server.is_cluster_connection_member():
                server_uri_templates.append(server.get_address_display())

        creds = "[<dbuser>:<dbpass>@]" if auth else ""
        return "mongodb://%s%s%s?replicaSet=%s" % (creds, ",".join(server_uri_templates), db, self.id)
dataset/ETHPy150Open mongolab/mongoctl/mongoctl/objects/cluster.py/Cluster.get_mongo_uri_template/original