Implemented the floating ip update API method

This commit is contained in:
Alan Quillin
2015-06-05 13:58:01 -05:00
parent ed60148090
commit 55d0f0685d
7 changed files with 387 additions and 65 deletions

View File

@@ -276,13 +276,15 @@ def _make_ip_policy_dict(ipp):
"exclude": [ippc["cidr"] for ippc in ipp["exclude"]]}
def _make_floating_ip_dict(flip):
ports = flip.ports
port_id = None
if ports and len(ports) > 0:
port_id = None if not ports[0] else ports[0].id
def _make_floating_ip_dict(flip, port_id=None):
if not port_id:
ports = flip.ports
port_id = None
if ports and len(ports) > 0:
port_id = None if not ports[0] else ports[0].id
fixed_ip = flip.fixed_ip
return {"id": flip.get("id"),
"floating_network_id": flip.get("network_id"),
"router_id": CONF.QUARK.floating_ip_router_id,