Skip to content
Snippets Groups Projects
Commit 9132db30 authored by Erik Reid's avatar Erik Reid
Browse files

make service redis key prettier

parent 25625dc0
No related branches found
No related tags found
No related merge requests found
......@@ -763,7 +763,10 @@ def update_circuit_hierarchy_and_port_id_services(self, use_current=False):
_format_service(circ)
service_type_key = re.sub(
r'[^a-zA-Z]+', '_', circ['service_type'].lower())
r'[^a-zA-Z0-9]+', '_', circ['service_type'].lower())
# prettification ... e.g. no trailing _ for 'MD-VPN (NATIVE)'
service_type_key = re.sub('_+$', '', service_type_key)
service_type_key = re.sub('^_+', '', service_type_key)
type_services = services_by_type.setdefault(
service_type_key, dict())
......
......@@ -95,11 +95,11 @@ def test_all_services(client):
('gws_upstream', 'GWS - UPSTREAM'),
('geant_ip', 'GEANT IP'),
('geant_lambda', 'GEANT LAMBDA'),
# ('gts', 'GTS'), # these are non-monitored (TODO: make a flag)
('md_vpn_native_', 'MD-VPN (NATIVE)'),
('md_vpn_proxy_', 'MD-VPN (PROXY)'),
# ('cbl1', 'CBL1'),
# ('l3_vpn', 'L3-VPN')
# ('gts', 'GTS'), # these are non-monitored (TODO: make a flag?)
('md_vpn_native', 'MD-VPN (NATIVE)'),
('md_vpn_proxy', 'MD-VPN (PROXY)'),
('cbl1', 'CBL1'),
('l3_vpn', 'L3-VPN')
])
def test_all_services_by_type(client, uri_type, expected_type):
rv = client.get(
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment