From a1def6dba83b829b93874061e2bce38d901c1b5f Mon Sep 17 00:00:00 2001 From: Robert Latta <robert.latta@geant.org> Date: Mon, 9 Nov 2020 15:52:11 +0000 Subject: [PATCH] replaced old string formatting with fstrings --- inventory_provider/routes/ims_classifier.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/inventory_provider/routes/ims_classifier.py b/inventory_provider/routes/ims_classifier.py index f5bec7ba..96b63a0f 100644 --- a/inventory_provider/routes/ims_classifier.py +++ b/inventory_provider/routes/ims_classifier.py @@ -110,7 +110,7 @@ def after_request(resp): def related_interfaces(hostname, interface): r = common.get_current_redis() - prefix = 'netconf-interfaces:%s:' % hostname + prefix = f'netconf-interfaces:{hostname}:' for k in r.keys(prefix + interface + '.*'): k = k.decode('utf-8') assert k.startswith(prefix) # sanity @@ -263,7 +263,7 @@ def ix_peering_info(peer_info): address = ipaddress.ip_address(peer_info['name']) except ValueError: raise ClassifierProcessingError( - 'unable to parse %r as an ip address' % address) + f'unable to parse {address} as an ip address') description = peer_info['description'] assert description is not None # sanity @@ -373,7 +373,7 @@ def peer_info(address): result['ix-public-peer-info'] = ix_peering_info(info) result['locations'] += _location_from_equipment(info['router']) - info = r.get('vpn_rr_peer:%s' % address) + info = r.get(f'vpn_rr_peer:{address}') if info: info = info.decode('utf-8') info = json.loads(info) -- GitLab