Revision 6e73f499 snf-cyclades-app/synnefo/logic/servers.py

b/snf-cyclades-app/synnefo/logic/servers.py
499 499

  
500 500
    Send a Job to remove the NIC card from the instance. The port
501 501
    will be deleted and the associated IPv4 addressess will be released
502
    when the job completes successfully. Deleting port that is connected to
503
    a public network is allowed only if the port has an associated floating IP
504
    address.
502
    when the job completes successfully.
505 503

  
506 504
    """
507 505

  
508
    if port.network.public and not port.ips.filter(floating_ip=True,
509
                                                   deleted=False).exists():
510
        raise faults.Forbidden("Cannot disconnect from public network.")
511

  
512 506
    if port.machine is not None:
513 507
        vm = disconnect(port.machine, port)
514 508
        log.info("Removing port %s, Job: %s", port, vm.task_job_id)

Also available in: Unified diff