From 8e42f584a9587e9b755e13098d2761bb4d1ea53a Mon Sep 17 00:00:00 2001 From: Matthew Booth Date: Thu, 13 Nov 2014 11:59:04 +0000 Subject: [PATCH] Remove unused db.api.instance_get_floating_address The last use was removed in change Ia79030e5bcfc55e5a33b20a3d6eead01fa5b255a: Migrate floating ip addresses in multi_host live_migration Change-Id: I9572c8fc70c92c7b63ae568613314c645eb1645d --- nova/db/api.py | 5 ----- nova/db/sqlalchemy/api.py | 23 ----------------------- 2 files changed, 28 deletions(-) diff --git a/nova/db/api.py b/nova/db/api.py index 356a9fd71423..52aecedeb53b 100644 --- a/nova/db/api.py +++ b/nova/db/api.py @@ -733,11 +733,6 @@ def instance_get_all_by_host_and_not_type(context, host, type_id=None): return IMPL.instance_get_all_by_host_and_not_type(context, host, type_id) -def instance_get_floating_address(context, instance_id): - """Get the first floating ip address of an instance.""" - return IMPL.instance_get_floating_address(context, instance_id) - - def instance_floating_address_get_all(context, instance_uuid): """Get all floating ip addresses of an instance.""" return IMPL.instance_floating_address_get_all(context, instance_uuid) diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index be34dba89915..ca5b2ab8cab9 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -2316,29 +2316,6 @@ def instance_get_all_by_host_and_not_type(context, host, type_id=None): filter(models.Instance.instance_type_id != type_id).all()) -# NOTE(jkoelker) This is only being left here for compat with floating -# ips. Currently the network_api doesn't return floaters -# in network_info. Once it starts return the model. This -# function and its call in compute/manager.py on 1829 can -# go away -@require_context -def instance_get_floating_address(context, instance_id): - instance = instance_get(context, instance_id) - fixed_ips = fixed_ip_get_by_instance(context, instance['uuid']) - - if not fixed_ips: - return None - - # NOTE(tr3buchet): this only gets the first fixed_ip - # won't find floating ips associated with other fixed_ips - floating_ips = floating_ip_get_by_fixed_address(context, - fixed_ips[0]['address']) - if not floating_ips: - return None - # NOTE(vish): this just returns the first floating ip - return floating_ips[0]['address'] - - @require_context def instance_floating_address_get_all(context, instance_uuid): if not uuidutils.is_uuid_like(instance_uuid):