Return ProxyCommand configuration string for ssh/scp command.

    All gateway options should not include quotes (' or "). To support
    future user configuration, please make sure to update the dictionary
    from __ssh_gateway_config_dict and get_ssh_gateway_config (ec2.py)

def __ssh_gateway_arguments(kwargs):
    '''
    Return ProxyCommand configuration string for ssh/scp command.

    All gateway options should not include quotes (' or "). To support
    future user configuration, please make sure to update the dictionary
    from __ssh_gateway_config_dict and get_ssh_gateway_config (ec2.py)
    '''
    extended_arguments = ""

    ssh_gateway = kwargs.get('ssh_gateway', '')
    ssh_gateway_port = 22
    if ':' in ssh_gateway:
        ssh_gateway, ssh_gateway_port = ssh_gateway.split(':')
    ssh_gateway_command = kwargs.get('ssh_gateway_command', 'nc -q0 %h %p')

    if ssh_gateway:
        ssh_gateway_port = kwargs.get('ssh_gateway_port', ssh_gateway_port)
        ssh_gateway_key = '-i {0}'.format(kwargs['ssh_gateway_key']) if 'ssh_gateway_key' in kwargs else ''
        ssh_gateway_user = kwargs.get('ssh_gateway_user', 'root')

        # Setup ProxyCommand
        extended_arguments = '-oProxyCommand="ssh {0} {1} {2} {3} {4}@{5} -p {6} {7}"'.format(
                # Don't add new hosts to the host key database
                '-oStrictHostKeyChecking=no',
                # Set hosts key database path to /dev/null, i.e., non-existing
                '-oUserKnownHostsFile=/dev/null',
                # Don't re-use the SSH connection. Less failures.
                '-oControlPath=none',
                ssh_gateway_key,
                ssh_gateway_user,
                ssh_gateway,
                ssh_gateway_port,
                ssh_gateway_command
            )

        log.info(
            'Using SSH gateway %s@%s:%s %s',
            ssh_gateway_user, ssh_gateway, ssh_gateway_port, ssh_gateway_command
        )

    return extended_arguments