<s> __author__ = '<STR_LIT>' <EOL> import mongoctl . repository as repository <EOL> from mongoctl . mongoctl_logging import * <EOL> from mongoctl . errors import MongoctlException <EOL> from mongoctl . utils import document_pretty_string <EOL> from mongoctl . objects . mongod import MongodServer <EOL> def status_command ( parsed_options ) : <EOL> id = parsed_options . id <EOL> server = repository . lookup_server ( id ) <EOL> if server : <EOL> log_info ( "<STR_LIT>" % id ) <EOL> status = server . get_status ( admin = True ) <EOL> else : <EOL> cluster = repository . lookup_cluster ( id ) <EOL> if cluster : <EOL> log_info ( "<STR_LIT>" % id ) <EOL> status = cluster . get_status ( ) <EOL> else : <EOL> raise MongoctlException ( "<STR_LIT>" <EOL> "<STR_LIT>" % id ) <EOL> status_str = document_pretty_string ( status ) <EOL> stdout_log ( status_str ) <EOL> return status </s>
