Merge "Do not call servers_update_addresses if no instances loaded"

This commit is contained in:
Jenkins 2017-10-06 11:45:03 +00:00 committed by Gerrit Code Review
commit bc80696cd8
1 changed files with 4 additions and 0 deletions

View File

@ -1470,6 +1470,10 @@ def servers_update_addresses(request, servers, all_tenants=False):
and Nova's networking info caching mechanism is not fast enough.
"""
# NOTE(e0ne): we don't need to call neutron if we have no instances
if not servers:
return
# Get all (filtered for relevant servers) information from Neutron
try:
# NOTE(e0ne): we need tuple here to work with @memoized decorator.