Fix masked variable name

The loop variable service_type masks the parameter service_type. It's
not a problem in this patch, but becomes a redefinition in the next
patch. It's pulled out here to not mix concerns.

Change-Id: I489d7ecad3f38b15eaa71449461cdd83782bac7a
Monty Taylor 2017-07-16 08:47:28 -05:00 committed by Eric Fried
parent e1243d924b
commit dc667f7354
1 changed files with 3 additions and 3 deletions

View File

@ -206,9 +206,9 @@ class ServiceCatalog(object):
return matching_endpoints
ret = {}
for service_type, endpoints in matching_endpoints.items():
for matched_service_type, endpoints in matching_endpoints.items():
if not endpoints:
ret[service_type] = []
ret[matched_service_type] = []
matches_by_interface = {}
for endpoint in endpoints:
@ -216,7 +216,7 @@ class ServiceCatalog(object):
best_interface = [i for i in interfaces
if i in matches_by_interface.keys()][0]
ret[service_type] = matches_by_interface[best_interface]
ret[matched_service_type] = matches_by_interface[best_interface]
return ret