Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
controller
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review analytics
Issue analytics
Insights
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
TFS
controller
Commits
f00ccfaf
Commit
f00ccfaf
authored
2 years ago
by
Ville Hallivuori
Browse files
Options
Downloads
Patches
Plain Diff
Fix xr service handler for cases where XR constellation is represented as single device
parent
741d929b
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!142
Release TeraFlowSDN 2.1
,
!85
Fix xr service handler for cases where XR constellation is represented as single device
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/service/service/service_handlers/tapi_xr/TapiXrServiceHandler.py
+16
-2
16 additions, 2 deletions
.../service/service_handlers/tapi_xr/TapiXrServiceHandler.py
with
16 additions
and
2 deletions
src/service/service/service_handlers/tapi_xr/TapiXrServiceHandler.py
+
16
−
2
View file @
f00ccfaf
...
...
@@ -42,6 +42,13 @@ class TapiXrServiceHandler(_ServiceHandler):
)
->
List
[
Union
[
bool
,
Exception
]]:
chk_type
(
'
endpoints
'
,
endpoints
,
list
)
# When using regular mode where XR constellation is a single device, we get two endpoints.
# Convert that representation to a form that is understood by the service handler that
# expects constellation to be represented as multiple devices.
if
len
(
endpoints
)
==
2
:
endpoints
=
[
None
,
endpoints
[
0
],
endpoints
[
1
],
None
]
if
len
(
endpoints
)
!=
4
:
return
[]
service_uuid
=
self
.
__service
.
service_id
.
service_uuid
.
uuid
...
...
@@ -68,10 +75,17 @@ class TapiXrServiceHandler(_ServiceHandler):
raise
Exception
(
'
Different Src-Dst devices not supported by now
'
)
controller
=
src_controller
# If the special mode that splits XR constellation to multiple modelled devices is used,
# add the device name to interface name. Otherwise use it as is (it will already contain pipe character
# end edge device name). This code should be refactored, as interface name structure is internal matter
# to XR driver and subject to change.
constellation_unique_src
=
src_endpoint
.
name
if
"
|
"
in
src_endpoint
.
name
else
'
|
'
.
join
([
src_device
.
name
,
src_endpoint
.
name
])
constellation_unique_dst
=
dst_endpoint
.
name
if
"
|
"
in
dst_endpoint
.
name
else
'
|
'
.
join
([
dst_device
.
name
,
dst_endpoint
.
name
])
json_config_rule
=
json_config_rule_set
(
'
/services/service[{:s}]
'
.
format
(
service_uuid
),
{
'
uuid
'
:
service_uuid
,
'
input_sip_name
'
:
'
|
'
.
join
([
src_device
.
name
,
src_endpoint
.
name
])
,
'
output_sip_name
'
:
'
|
'
.
join
([
dst_device
.
name
,
dst_endpoint
.
name
])
,
'
input_sip_name
'
:
constellation_unique_src
,
'
output_sip_name
'
:
constellation_unique_dst
,
'
capacity_unit
'
:
capacity_unit
,
'
capacity_value
'
:
capacity_value
,
})
...
...
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