# Path: mongoctl/users.py
# def parse_global_login_user_arg(username, password, server_id):
# def get_global_login_user(server, dbname):
# def setup_server_users(server):
# def setup_cluster_users(cluster, primary_server):
# def should_seed_db_users(server, dbname):
# def setup_db_users(server, db, db_users):
# def _mongo_add_user(server, db, username, password, read_only=False,
#                     num_tries=1):
# def list_database_users(server, db):
# def setup_server_db_users(server, dbname, db_users):
# def prepend_global_admin_user(other_users, server):
# def setup_server_admin_users(server):
# def setup_root_admin_user(server, admin_users):
# def setup_server_local_users(server):
# def read_seed_password(dbname, username):
# def set_server_login_user(server, dbname, username, password):
# def get_server_login_user(server, dbname):
# def _get_server_login_record(server, create_new=True):
# def is_system_user(username):
# LOGIN_USERS = {}
# 
# Path: mongoctl/config.py
# def get_cluster_member_alt_address_mapping():
#     return get_mongoctl_config_val('clusterMemberAltAddressesMapping', {})
# 
# Path: mongoctl/mongoctl_logging.py
# def log_verbose(msg):
#     get_logger().log(VERBOSE, msg)
# 
# def log_error(msg):
#     get_logger().error(msg)
# 
# def log_db_command(cmd):
#     log_info( "Executing db command %s" % utils.document_pretty_string(cmd))


import mongoctl.repository as repository
from cluster import Cluster
from mongoctl import users
from base import DocumentWrapper
from mongoctl.utils import *
from bson import DBRef
from mongoctl.config import get_cluster_member_alt_address_mapping
from mongoctl.mongoctl_logging import log_verbose, log_error, log_db_command
from mongoctl.prompt import prompt_confirm
        return not self.is_arbiter() and self.get_priority() != 0

    ###########################################################################
    def get_member_repl_config(self):

        # create the member repl config with host

        member_conf = {"host": self.get_host()}

        # Add the rest of the properties configured in the document
        #  EXCEPT host/server

        ignore = ['host', 'server']

        for key,value in self.__document__.items():
            if key not in ignore :
                member_conf[key] = value

        self._apply_alt_address_mapping(member_conf)

        return member_conf

    ###########################################################################
    def _apply_alt_address_mapping(self, member_conf):

        # Not applicable to arbiters
        if self.is_arbiter():
            return

        tag_mapping = get_cluster_member_alt_address_mapping()

# Path: mongoctl/users.py
# def parse_global_login_user_arg(username, password, server_id):
# def get_global_login_user(server, dbname):
# def setup_server_users(server):
# def setup_cluster_users(cluster, primary_server):
# def should_seed_db_users(server, dbname):
# def setup_db_users(server, db, db_users):
# def _mongo_add_user(server, db, username, password, read_only=False,
#                     num_tries=1):
# def list_database_users(server, db):
# def setup_server_db_users(server, dbname, db_users):
# def prepend_global_admin_user(other_users, server):
# def setup_server_admin_users(server):
# def setup_root_admin_user(server, admin_users):
# def setup_server_local_users(server):
# def read_seed_password(dbname, username):
# def set_server_login_user(server, dbname, username, password):
# def get_server_login_user(server, dbname):
# def _get_server_login_record(server, create_new=True):
# def is_system_user(username):
# LOGIN_USERS = {}
# 
# Path: mongoctl/config.py
# def get_cluster_member_alt_address_mapping():
#     return get_mongoctl_config_val('clusterMemberAltAddressesMapping', {})
# 
# Path: mongoctl/mongoctl_logging.py
# def log_verbose(msg):
#     get_logger().log(VERBOSE, msg)
# 
# def log_error(msg):
#     get_logger().error(msg)
# 
# def log_db_command(cmd):
#     log_info( "Executing db command %s" % utils.document_pretty_string(cmd))


# Path: mongoctl/objects/replicaset_cluster.py
import mongoctl.repository as repository
from cluster import Cluster
from mongoctl import users
from base import DocumentWrapper
from mongoctl.utils import *
from bson import DBRef
from mongoctl.config import get_cluster_member_alt_address_mapping
from mongoctl.mongoctl_logging import log_verbose, log_error, log_db_command
from mongoctl.prompt import prompt_confirm

        return not self.is_arbiter() and self.get_priority() != 0

    ###########################################################################
    def get_member_repl_config(self):

        # create the member repl config with host

        member_conf = {"host": self.get_host()}

        # Add the rest of the properties configured in the document
        #  EXCEPT host/server

        ignore = ['host', 'server']

        for key,value in self.__document__.items():
            if key not in ignore :
                member_conf[key] = value

        self._apply_alt_address_mapping(member_conf)

        return member_conf

    ###########################################################################
    def _apply_alt_address_mapping(self, member_conf):

        # Not applicable to arbiters
        if self.is_arbiter():
            return

        tag_mapping = get_cluster_member_alt_address_mapping()

        if not tag_mapping: