From c13f42e36cddd820b475ffecf1f3a9e894d0cc04 Mon Sep 17 00:00:00 2001 From: Dan Smith Date: Thu, 7 May 2015 08:42:49 -0700 Subject: [PATCH] Log the actual instance.info_cache when empty in floating ip associate This attempts to add some enlightenment to the case where we try to associate a floating ip for an instance and hit the case where there is no info_cache. We need to know if it's actually None, or empty. Related-Bug: #1249065 Change-Id: Ic0051d1d520f800d845b7006b5b95be5d8edf7c9 --- nova/api/openstack/compute/contrib/floating_ips.py | 3 +++ nova/api/openstack/compute/plugins/v3/floating_ips.py | 3 +++ 2 files changed, 6 insertions(+) diff --git a/nova/api/openstack/compute/contrib/floating_ips.py b/nova/api/openstack/compute/contrib/floating_ips.py index 0be23ebfc2de..a5b0697a11f6 100644 --- a/nova/api/openstack/compute/contrib/floating_ips.py +++ b/nova/api/openstack/compute/contrib/floating_ips.py @@ -181,6 +181,9 @@ class FloatingIPActionController(wsgi.Controller): instance = common.get_instance(self.compute_api, context, id) cached_nwinfo = compute_utils.get_nw_info_for_instance(instance) if not cached_nwinfo: + LOG.warning( + _LW('Info cache is %r during associate') % instance.info_cache, + instance=instance) msg = _('No nw_info cache associated with instance') raise webob.exc.HTTPBadRequest(explanation=msg) diff --git a/nova/api/openstack/compute/plugins/v3/floating_ips.py b/nova/api/openstack/compute/plugins/v3/floating_ips.py index 11a0e8d0aab8..c8825109c250 100644 --- a/nova/api/openstack/compute/plugins/v3/floating_ips.py +++ b/nova/api/openstack/compute/plugins/v3/floating_ips.py @@ -194,6 +194,9 @@ class FloatingIPActionController(wsgi.Controller): instance = common.get_instance(self.compute_api, context, id) cached_nwinfo = compute_utils.get_nw_info_for_instance(instance) if not cached_nwinfo: + LOG.warning( + _LW('Info cache is %r during associate') % instance.info_cache, + instance=instance) msg = _('No nw_info cache associated with instance') raise webob.exc.HTTPBadRequest(explanation=msg)