Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
inventory-provider
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
geant-swd
dashboardv3
inventory-provider
Commits
0ca5be06
Commit
0ca5be06
authored
1 year ago
by
geant-release-service
Browse files
Options
Downloads
Plain Diff
Finished release 0.116.
parents
01caae18
4208fda0
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
inventory_provider/tasks/worker.py
+22
-7
22 additions, 7 deletions
inventory_provider/tasks/worker.py
setup.py
+1
-1
1 addition, 1 deletion
setup.py
with
23 additions
and
8 deletions
inventory_provider/tasks/worker.py
+
22
−
7
View file @
0ca5be06
...
@@ -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
):
...
...
This diff is collapsed.
Click to expand it.
setup.py
+
1
−
1
View file @
0ca5be06
...
@@ -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.11
5
"
,
version
=
"
0.11
6
"
,
author
=
'
GEANT
'
,
author
=
'
GEANT
'
,
author_email
=
'
swd@geant.org
'
,
author_email
=
'
swd@geant.org
'
,
description
=
'
Dashboard inventory provider
'
,
description
=
'
Dashboard inventory provider
'
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment