Example #1
0
def check_floatingip_pool_exists(ng_name, pool_id):
    network = None
    if CONF.use_neutron:
        network = nova.get_network(id=pool_id)
    else:
        for net in nova.client().floating_ip_pools.list():
            if net.name == pool_id:
                network = net.name
                break

    if not network:
        raise ex.NotFoundException(pool_id, _("Floating IP pool %s not found"))
Example #2
0
def check_floatingip_pool_exists(ng_name, pool_id):
    network = None
    if CONF.use_neutron:
        network = nova.get_network(id=pool_id)
    else:
        for net in nova.client().floating_ip_pools.list():
            if net.name == pool_id:
                network = net.name
                break

    if not network:
        raise ex.InvalidException("Floating IP pool %s for node group "
                                  "'%s' not found" % (pool_id, ng_name))
Example #3
0
def check_floatingip_pool_exists(ng_name, pool_id):
    network = None
    if CONF.use_neutron:
        network = nova.get_network(id=pool_id)
    else:
        for net in nova.client().floating_ip_pools.list():
            if net.name == pool_id:
                network = net.name
                break

    if not network:
        raise ex.InvalidException(
            _("Floating IP pool %(pool)s for node group '%(group)s' "
              "not found") % {'pool': pool_id, 'group': ng_name})
Example #4
0
def check_floatingip_pool_exists(ng_name, pool_id):
    network = None
    if CONF.use_neutron:
        network = nova.get_network(id=pool_id)
    else:
        # tmckay-fp, whoa, this suggests that we allow floating_ip_pools with
        # nova?  Can that be true? Scour for this
        for net in nova.client().floating_ip_pools.list():
            if net.name == pool_id:
                network = net.name
                break

    if not network:
        raise ex.NotFoundException(pool_id, _("Floating IP pool %s not found"))
Example #5
0
def check_network_exists(net_id):
    if not nova.get_network(id=net_id):
        raise ex.InvalidException("Network %s not found" % net_id)
Example #6
0
def check_network_exists(net_id):
    if not nova.get_network(id=net_id):
        raise ex.NotFoundException(net_id, _("Network %s not found"))