<commit_before>__author__ = 'abdul'

import mongoctl.repository as repository

from mongoctl.mongoctl_logging import *
from mongoctl.errors import MongoctlException
from mongoctl.utils import document_pretty_string
from mongoctl.objects.mongod import MongodServer
###############################################################################
# status command TODO: parsed?
###############################################################################
def status_command(parsed_options):
    # we need to print status json to stdout so that its seperate from all
    # other messages that are printed on stderr. This is so scripts can read
    # status json and parse it if it needs

    id = parsed_options.id
    server = repository.lookup_server(id)
    if server:
        log_info("Status for server '%s':" % id)
        if isinstance(server, MongodServer) and server.is_arbiter_server():
            status = server.get_status(admin=False)
        else:<commit_msg>Get full status from arbiters<commit_after>__author__ = 'abdul'

import mongoctl.repository as repository

from mongoctl.mongoctl_logging import *
from mongoctl.errors import MongoctlException
from mongoctl.utils import document_pretty_string
from mongoctl.objects.mongod import MongodServer
###############################################################################
# status command TODO: parsed?
###############################################################################
def status_command(parsed_options):
    # we need to print status json to stdout so that its seperate from all
    # other messages that are printed on stderr. This is so scripts can read
    # status json and parse it if it needs

    id = parsed_options.id
    server = repository.lookup_server(id)
    if server:
        log_info("Status for server '%s':" % id)
        if isinstance(server, MongodServer) and server.is_arbiter_server():
            # XXX? TODO we use to pass admin=False to arbiters but maybe this should be fine now
            status = server.get_status(admin=True)
        else:
{'fraction_non_alphanumeric': 0.2055393586005831, 'fraction_numerical': 0.0, 'mean_word_length': 4.6256830601092895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6520683', 'n_tokens_mistral': 523, 'n_tokens_neox': 506, 'n_words': 181}