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
f03d6f3d
Commit
f03d6f3d
authored
4 years ago
by
Vidya Ambadipudi
Committed by
Robert Latta
4 years ago
Browse files
Options
Downloads
Patches
Plain Diff
added more categories for service classification
parent
99691c0e
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
+25
-4
25 additions, 4 deletions
inventory_provider/tasks/worker.py
test/test_worker_utils.py
+13
-3
13 additions, 3 deletions
test/test_worker_utils.py
with
38 additions
and
7 deletions
inventory_provider/tasks/worker.py
+
25
−
4
View file @
f03d6f3d
...
...
@@ -689,17 +689,38 @@ def refresh_finalizer(self, pending_task_ids_json):
class
PollerServiceCategory
(
str
,
enum
.
Enum
):
MDVPN
=
'
mdvpn
'
LHCONE
=
'
lhcone
'
LHCONE_CUST
=
'
lhcone_cust
'
LHCONE_PEER
=
'
lhcone_peer
'
L2_Circuits
=
'
l2_circuits
'
IAS
=
'
ias
'
RE_CUST
=
'
re_cust
'
RE_PEER
=
'
re_peer
'
BACKBONE
=
'
backbone
'
@log_task_entry_and_exit
def
_build_service_category_interface_list
(
update_callback
=
lambda
s
:
None
):
def
_classify
(
ifc
):
if
ifc
[
'
description
'
].
startswith
(
'
SRV_MDVPN
'
):
if
ifc
[
'
description
'
].
startswith
(
'
SRV_MDVPN
CUSTOMER
'
):
yield
PollerServiceCategory
.
MDVPN
if
'
LHCONE
'
in
ifc
[
'
description
'
]:
yield
PollerServiceCategory
.
LHCONE
if
'
LHCONE
'
in
ifc
[
'
description
'
]
\
and
'
SRV_L3VPN CUSTOMER
'
in
ifc
[
'
description
'
]:
yield
PollerServiceCategory
.
LHCONE_CUST
if
'
LHCONE
'
in
ifc
[
'
description
'
]
\
and
'
SRV_L3VPN RE
'
in
ifc
[
'
description
'
]:
yield
PollerServiceCategory
.
LHCONE_PEER
if
'
SRV_L2CIRCUIT
'
in
ifc
[
'
description
'
]
\
and
'
SRV_L3VPN
'
in
ifc
[
'
description
'
]:
yield
PollerServiceCategory
.
L2_Circuits
if
'
PHY CUSTOMER
'
in
ifc
[
'
description
'
]
\
and
'
LAG CUSTOMER
'
in
ifc
[
'
description
'
]
\
and
'
SRV_GLOBAL CUSTOMER
'
in
ifc
[
'
description
'
]:
yield
PollerServiceCategory
.
RE_CUST
if
'
SRV_GLOBAL RE_INTERCONNECT
'
in
ifc
[
'
description
'
]:
yield
PollerServiceCategory
.
RE_PEER
if
'
SRV_IAS CUSTOMER
'
in
ifc
[
'
description
'
]:
yield
PollerServiceCategory
.
IAS
update_callback
(
'
loading all known interfaces
'
)
interfaces
=
data
.
build_service_interface_user_list
(
InventoryTask
.
config
)
...
...
This diff is collapsed.
Click to expand it.
test/test_worker_utils.py
+
13
−
3
View file @
f03d6f3d
...
...
@@ -61,9 +61,19 @@ def test_build_interface_services(mocked_worker_module):
seen_types
.
add
(
type
)
assert
type
in
(
'
mdvpn
'
,
'
lhcone
'
)
expected_seen_types
=
set
([
'
mdvpn
'
,
'
lhcone
'
])
assert
type
in
(
'
mdvpn
'
,
'
lhcone_peer
'
,
'
re_peer
'
,
'
ias
'
,
'
lhcone
'
,
'
lhcone_cust
'
)
expected_seen_types
=
set
([
'
mdvpn
'
,
'
lhcone_peer
'
,
'
re_peer
'
,
'
ias
'
,
'
lhcone
'
,
'
lhcone_cust
'
])
assert
seen_types
==
expected_seen_types
...
...
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