Commit 39283f1f authored by Christos Stavrakakis's avatar Christos Stavrakakis
Browse files

cyclades: Check if network exists in backend

Raise 503 if a user tries to add a floating IP to a VM that resides in a
Ganeti backend that the coressponding network does not exist.
parent 9912e839
......@@ -394,6 +394,12 @@ def add_floating_ip(vm, address):
raise faults.Conflict("Floating IP '%s' already in use" %
bnet =
if not bnet.exists():
msg = "Network '%s' is a floating IP pool, but it not connected"\
" to backend '%s'" % (, vm.backend)
raise faults.ServiceUnavailable(msg)
floating_ip.machine = vm
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment