diff --git a/inventory_provider/routes/classifier.py b/inventory_provider/routes/classifier.py index 76bae8564c1557e34ea09fcc163f96c5a32d92db..a64a662d9f80d0a1ab56c01cf565636a44ae80ad 100644 --- a/inventory_provider/routes/classifier.py +++ b/inventory_provider/routes/classifier.py @@ -152,8 +152,8 @@ def get_juniper_link_info(source_equipment, interface): result['services'] = json.loads(services.decode('utf=8')) for s in result['services']: top_level_services.extend(get_top_level_services(s['id'], r)) - l = [_location_from_service_dict(s) for s in result['services']] - result['locations'] += l + result['locations'] += [ + _location_from_service_dict(s) for s in result['services']] ifc_info = r.get( 'netconf-interfaces:%s:%s' % (source_equipment, interface)) @@ -265,7 +265,6 @@ def find_interfaces(address): yield ifc - def find_interfaces_and_services(address_str): """ @@ -342,8 +341,8 @@ def peer_info(address): if interfaces: result['interfaces'] = interfaces for i in interfaces: - l = [_location_from_service_dict(s) for s in i['services']] - result['locations'] += l + result['locations'] += [ + _location_from_service_dict(s) for s in i['services']] result['locations'] = _unique_dicts_from_list(result['locations']) result = json.dumps(result) @@ -384,8 +383,8 @@ def get_trap_metadata(source_equipment, interface, circuit_id): top_level_services.extend(tls) if top_level_services: result['related-services'] = top_level_services - l = [_location_from_service_dict(s) for s in result['services']] - result['locations'] += l + result['locations'] += [ + _location_from_service_dict(s) for s in result['services']] gl = r.get('opsdb:geant_lambdas:%s' % circuit_id.lower()) if gl: diff --git a/test/test_classifier_routes.py b/test/test_classifier_routes.py index c0c92c13e36007c88f10a4d0a28047c5f16415f6..56821fcb4056b1107ad9f76fe5d103560525d309 100644 --- a/test/test_classifier_routes.py +++ b/test/test_classifier_routes.py @@ -386,7 +386,7 @@ def test_coriant_info( 'abbreviation': '999' } } - }) + }) rv = client.get( '/classifier/coriant-info/{equipment}/{entity}'.format( @@ -408,8 +408,12 @@ def test_coriant_info( 'E': equipment, 'CID': card_id, 'P': port_number, - 'a': {'equipment name': 'abc', 'pop': {'name': 'zzz', 'abbreviation': '123'}}, - 'b': {'equipment name': 'ddd', 'pop': {'name': 'aaa', 'abbreviation': '999'}} + 'a': { + 'equipment name': 'abc', + 'pop': {'name': 'zzz', 'abbreviation': '123'}}, + 'b': { + 'equipment name': 'ddd', + 'pop': {'name': 'aaa', 'abbreviation': '999'}} }, 'locations': [{ 'a': {'equipment': 'abc', 'name': 'zzz', 'abbreviation': '123'},