Skip to content
Snippets Groups Projects
Commit 0ca5be06 authored by geant-release-service's avatar geant-release-service
Browse files

Finished release 0.116.

parents 01caae18 4208fda0
No related branches found
No related tags found
No related merge requests found
...@@ -1634,13 +1634,19 @@ def populate_mic_with_third_party_data(interface_services, hierarchy, r): ...@@ -1634,13 +1634,19 @@ def populate_mic_with_third_party_data(interface_services, hierarchy, r):
'id': _circuit_data['id'], 'id': _circuit_data['id'],
'name': _circuit_data['name'] + ' (' + _circuit_data['sid'] + ')', 'name': _circuit_data['name'] + ' (' + _circuit_data['sid'] + ')',
'service_type': _circuit_data['product'], 'service_type': _circuit_data['product'],
'contacts': _circuit_data['contacts'],
'planned_work_contacts': _circuit_data['planned_work_contacts'],
} }
else: else:
return None return None
def get_related_services_for_third_party_type_circuit(_circuit_data): def get_related_services_for_third_party_type_circuit(_circuit_data):
related_service_ids = list(get_related_services_ids(_circuit_data['id'])) related_service_ids = list(get_related_services_ids(_circuit_data['id']))
related_services = [] related_services_info = {
'related_services': [],
'contacts': set(),
'planned_work_contacts': set()
}
seen_names = set() # Set to keep track of already added names seen_names = set() # Set to keep track of already added names
for rs_id in related_service_ids: for rs_id in related_service_ids:
rs_info = hierarchy.get(rs_id) rs_info = hierarchy.get(rs_id)
...@@ -1651,16 +1657,25 @@ def populate_mic_with_third_party_data(interface_services, hierarchy, r): ...@@ -1651,16 +1657,25 @@ def populate_mic_with_third_party_data(interface_services, hierarchy, r):
continue continue
name = formatted_rs['name'] name = formatted_rs['name']
if name not in seen_names: # Check if the name has not been seen before if name not in seen_names: # Check if the name has not been seen before
related_services.append({ related_services_info['related_services'].append({
'id': formatted_rs['id'], 'id': formatted_rs['id'],
'name': name, 'name': name,
'service_type': formatted_rs['service_type'] 'service_type': formatted_rs['service_type']
}) })
seen_names.add(name) # Add the name to the set of seen names for contact in formatted_rs['contacts']:
return related_services related_services_info['contacts'].add(contact)
for planned_work_contact in formatted_rs['planned_work_contacts']:
related_services_info['planned_work_contacts'].add(planned_work_contact)
seen_names.add(name)
return related_services_info
def _get_formatted_third_party_data(_circuit_data): def _get_formatted_third_party_data(_circuit_data):
if _circuit_data['status'] == 'operational' and _circuit_data.get('third_party_id'): if _circuit_data['status'] == 'operational' and _circuit_data.get('third_party_id'):
related_services_info = get_related_services_for_third_party_type_circuit(_circuit_data)
for contact in _circuit_data['contacts']:
related_services_info['contacts'].add(contact)
for planned_work_contact in _circuit_data['planned_work_contacts']:
related_services_info['planned_work_contacts'].add(planned_work_contact)
return { return {
'id': _circuit_data['id'], 'id': _circuit_data['id'],
'status': _circuit_data['status'], 'status': _circuit_data['status'],
...@@ -1668,10 +1683,10 @@ def populate_mic_with_third_party_data(interface_services, hierarchy, r): ...@@ -1668,10 +1683,10 @@ def populate_mic_with_third_party_data(interface_services, hierarchy, r):
'sid': _circuit_data.get('sid', ''), 'sid': _circuit_data.get('sid', ''),
'service': _circuit_data['circuit-type'], 'service': _circuit_data['circuit-type'],
'service_type': 'circuit_hierarchy', 'service_type': 'circuit_hierarchy',
'contacts': _circuit_data['contacts'], 'contacts': list(related_services_info['contacts']),
'planned_work_contacts': _circuit_data['planned_work_contacts'], 'planned_work_contacts': list(related_services_info['planned_work_contacts']),
'third_party_id': _circuit_data['third_party_id'], 'third_party_id': _circuit_data['third_party_id'],
'related_services': get_related_services_for_third_party_type_circuit(_circuit_data) 'related_services': related_services_info['related_services']
} }
def _get_formatted_related_service(_d): def _get_formatted_related_service(_d):
......
...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages ...@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
setup( setup(
name='inventory-provider', name='inventory-provider',
version="0.115", version="0.116",
author='GEANT', author='GEANT',
author_email='swd@geant.org', author_email='swd@geant.org',
description='Dashboard inventory provider', description='Dashboard inventory provider',
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment