@utils.synchronized(SERIAL_LOCK)
def acquire_port(host):

    start, stop = _get_port_range()

    for port in six.moves.range(start, stop):
        if (host, port) in ALLOCATED_PORTS:
            continue
        try:
            _verify_port(host, port)
            ALLOCATED_PORTS.add((host, port))
            return port
        except exception.SocketPortInUseException as e:
            LOG.warning(e.format_message())

    raise exception.SocketPortRangeExhaustedException(host=host)
:param app_id: ID of the app to remove
dataset/ETHPy150Open BU-NU-CLOUD-SP16/Trusted-Platform-Module-nova/nova/console/serial.py/acquire_port--crossover with--dataset/ETHPy150Open dcos/dcos-cli/cli/dcoscli/marathon/main.py/_remove