def __call_cli(jboss_config, command, retries=1):
    command_segments = [
        jboss_config['cli_path'],
        '--connect',
        '--controller="{0}"'.format(jboss_config['controller'])
    ]
    if 'cli_user' in six.iterkeys(jboss_config):
        command_segments.append('--user="{0}"'.format(jboss_config['cli_user']))
    if 'cli_password' in six.iterkeys(jboss_config):
        command_segments.append('--password="{0}"'.format(jboss_config['cli_password']))
    command_segments.append('--command="{0}"'.format(__escape_command(command)))
    cli_script = ' '.join(command_segments)

    cli_command_result = __salt__['cmd.run_all'](cli_script)
    log.debug('cli_command_result=%s', str(cli_command_result))

    log.debug('========= STDOUT:\n%s', cli_command_result['stdout'])
    log.debug('========= STDERR:\n%s', cli_command_result['stderr'])
    log.debug('========= RETCODE: %d', cli_command_result['retcode'])

    if cli_command_result['retcode'] == 127:
        raise CommandExecutionError('Could not execute jboss-cli.sh script. Have you specified server_dir variable correctly?\nCurrent CLI path: {cli_path}. '.format(cli_path=jboss_config['cli_path']))

    if cli_command_result['retcode'] == 1 and 'Unable to authenticate against controller' in cli_command_result['stderr']:
        raise CommandExecutionError('Could not authenticate against controller, please check username and password for the management console. Err code: {retcode}, stdout: {stdout}, stderr: {stderr}'.format(**cli_command_result))

    # It may happen that eventhough server is up it may not respond to the call
    if cli_command_result['retcode'] == 1 and cli_command_result['stderr'] in 'JBAS012144' and retries > 0:  # Cannot connect to cli
        log.debug('Command failed, retrying... (%d tries left)', retries)
        time.sleep(3)
        return __call_cli(jboss_config, command, retries - 1)

    return cli_command_result
dataset/ETHPy150Open saltstack/salt/salt/modules/jboss7_cli.py/__call_cli/swapped operands of `in`