Merge trunk.
This commit is contained in:
commit
385b992715
@ -261,11 +261,13 @@ def floating_ip_disassociate(context, address):
|
|||||||
return IMPL.floating_ip_disassociate(context, address)
|
return IMPL.floating_ip_disassociate(context, address)
|
||||||
|
|
||||||
|
|
||||||
def floating_ip_fixed_ip_associate(context, floating_address, fixed_address):
|
def floating_ip_fixed_ip_associate(context, floating_address,
|
||||||
|
fixed_address, host):
|
||||||
"""Associate an floating ip to a fixed_ip by address."""
|
"""Associate an floating ip to a fixed_ip by address."""
|
||||||
return IMPL.floating_ip_fixed_ip_associate(context,
|
return IMPL.floating_ip_fixed_ip_associate(context,
|
||||||
floating_address,
|
floating_address,
|
||||||
fixed_address)
|
fixed_address,
|
||||||
|
host)
|
||||||
|
|
||||||
|
|
||||||
def floating_ip_get_all(context):
|
def floating_ip_get_all(context):
|
||||||
@ -367,7 +369,7 @@ def fixed_ip_get_all(context):
|
|||||||
|
|
||||||
def fixed_ip_get_all_by_instance_host(context, host):
|
def fixed_ip_get_all_by_instance_host(context, host):
|
||||||
"""Get all allocated fixed ips filtered by instance host."""
|
"""Get all allocated fixed ips filtered by instance host."""
|
||||||
return IMPL.fixed_ip_get_all_instance_by_host(context, host)
|
return IMPL.fixed_ip_get_all_by_instance_host(context, host)
|
||||||
|
|
||||||
|
|
||||||
def fixed_ip_get_by_address(context, address):
|
def fixed_ip_get_by_address(context, address):
|
||||||
|
@ -529,7 +529,8 @@ def floating_ip_count_by_project(context, project_id):
|
|||||||
|
|
||||||
|
|
||||||
@require_context
|
@require_context
|
||||||
def floating_ip_fixed_ip_associate(context, floating_address, fixed_address):
|
def floating_ip_fixed_ip_associate(context, floating_address,
|
||||||
|
fixed_address, host):
|
||||||
session = get_session()
|
session = get_session()
|
||||||
with session.begin():
|
with session.begin():
|
||||||
# TODO(devcamcar): How to ensure floating_id belongs to user?
|
# TODO(devcamcar): How to ensure floating_id belongs to user?
|
||||||
@ -540,6 +541,7 @@ def floating_ip_fixed_ip_associate(context, floating_address, fixed_address):
|
|||||||
fixed_address,
|
fixed_address,
|
||||||
session=session)
|
session=session)
|
||||||
floating_ip_ref.fixed_ip = fixed_ip_ref
|
floating_ip_ref.fixed_ip = fixed_ip_ref
|
||||||
|
floating_ip_ref.host = host
|
||||||
floating_ip_ref.save(session=session)
|
floating_ip_ref.save(session=session)
|
||||||
|
|
||||||
|
|
||||||
@ -583,6 +585,7 @@ def floating_ip_disassociate(context, address):
|
|||||||
else:
|
else:
|
||||||
fixed_ip_address = None
|
fixed_ip_address = None
|
||||||
floating_ip_ref.fixed_ip = None
|
floating_ip_ref.fixed_ip = None
|
||||||
|
floating_ip_ref.host = None
|
||||||
floating_ip_ref.save(session=session)
|
floating_ip_ref.save(session=session)
|
||||||
return fixed_ip_address
|
return fixed_ip_address
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user