def stop_server(jboss_config, host=None):
    log.debug("======================== MODULE FUNCTION: jboss7.stop_server")
    if host is None:
        operation = ':shutdown'
    else:
        operation = '/host="{host}"/:shutdown'.format(host=host)
    shutdown_result = __salt__['jboss7_cli.run_operation'](jboss_config, operation, fail_on_error=False)
    # JBoss seems to occasionaly close the channel immediately when :shutdown is sent
    if shutdown_result['success'] or (not shutdown_result['success'] and 'Operation failed: Channel closed' in shutdown_result['stdout']):
        return shutdown_result
    else:
        raise Exception('''Cannot handle error, return code={retcode}, stdout='{stdout}', stderr='{stderr}' '''.format(**shutdown_result))
Stop running jboss instance
dataset/ETHPy150Open saltstack/salt/salt/modules/jboss7.py/stop_server