From 8333a1533c201a7aead2b9e422dea13a0c9e7a97 Mon Sep 17 00:00:00 2001 From: Dean Troyer Date: Tue, 17 Jan 2012 12:30:59 -0600 Subject: Fix nova-manage floating list (fixes bug 918804) https://review.openstack.org/2922 broke nova-manage floating list * Restore db.floating_ip_get_all * Update instance display in nova-manage Change-Id: I526237401371a21eafbd9b571f9b4a17a534c1c6 --- nova/db/api.py | 5 +++++ nova/db/sqlalchemy/api.py | 8 ++++++++ 2 files changed, 13 insertions(+) (limited to 'nova') diff --git a/nova/db/api.py b/nova/db/api.py index 9d29a0218..c9ffec7e4 100644 --- a/nova/db/api.py +++ b/nova/db/api.py @@ -290,6 +290,11 @@ def floating_ip_fixed_ip_associate(context, floating_address, host) +def floating_ip_get_all(context): + """Get all floating ips.""" + return IMPL.floating_ip_get_all(context) + + def floating_ip_get_all_by_host(context, host): """Get all floating ips by host.""" return IMPL.floating_ip_get_all_by_host(context, host) diff --git a/nova/db/sqlalchemy/api.py b/nova/db/sqlalchemy/api.py index b81de6d61..df6e5ddfe 100644 --- a/nova/db/sqlalchemy/api.py +++ b/nova/db/sqlalchemy/api.py @@ -623,6 +623,14 @@ def _floating_ip_get_all(context): return model_query(context, models.FloatingIp, read_deleted="no") +@require_admin_context +def floating_ip_get_all(context): + floating_ip_refs = _floating_ip_get_all(context).all() + if not floating_ip_refs: + raise exception.NoFloatingIpsDefined() + return floating_ip_refs + + @require_admin_context def floating_ip_get_all_by_host(context, host): floating_ip_refs = _floating_ip_get_all(context).\ -- cgit