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
9512d565
Commit
9512d565
authored
1 year ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Pre-release CI/CD pipeline fixes
parent
665f31e8
No related branches found
No related tags found
2 merge requests
!142
Release TeraFlowSDN 2.1
,
!137
Pre-release CI/CD fixes - Service - PathComp
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/common/tests/MockServicerImpl_Context.py
+16
-8
16 additions, 8 deletions
src/common/tests/MockServicerImpl_Context.py
with
16 additions
and
8 deletions
src/common/tests/MockServicerImpl_Context.py
+
16
−
8
View file @
9512d565
...
...
@@ -14,6 +14,7 @@
import
grpc
,
json
,
logging
from
typing
import
Any
,
Dict
,
Iterator
,
List
,
Set
from
common.Constants
import
DEFAULT_CONTEXT_NAME
,
DEFAULT_TOPOLOGY_NAME
from
common.proto.context_pb2
import
(
Connection
,
ConnectionEvent
,
ConnectionId
,
ConnectionIdList
,
ConnectionList
,
Context
,
ContextEvent
,
ContextId
,
ContextIdList
,
ContextList
,
...
...
@@ -164,17 +165,24 @@ class MockServicerImpl_Context(ContextServiceServicer):
def
GetTopologyDetails
(
self
,
request
:
TopologyId
,
context
:
grpc
.
ServicerContext
)
->
TopologyDetails
:
LOGGER
.
info
(
'
[GetTopologyDetails] request={:s}
'
.
format
(
grpc_message_to_json_string
(
request
)))
container_name
=
'
topology[{:s}]
'
.
format
(
str
(
request
.
context_id
.
context_uuid
.
uuid
))
_reply
=
get_entry
(
context
,
self
.
database
,
container_name
,
request
.
topology_uuid
.
uuid
)
context_uuid
=
request
.
context_id
.
context_uuid
.
uuid
container_name
=
'
topology[{:s}]
'
.
format
(
str
(
context_uuid
))
topology_uuid
=
request
.
topology_uuid
.
uuid
_reply
=
get_entry
(
context
,
self
.
database
,
container_name
,
topology_uuid
)
reply
=
TopologyDetails
()
reply
.
topology_id
.
CopyFrom
(
_reply
.
topology_id
)
reply
.
name
=
_reply
.
name
for
device_id
in
_reply
.
device_ids
:
device
=
get_entry
(
context
,
self
.
database
,
'
device
'
,
device_id
.
device_uuid
.
uuid
)
reply
.
devices
.
append
(
device
)
for
link_id
in
_reply
.
link_ids
:
link
=
get_entry
(
context
,
self
.
database
,
'
link
'
,
link_id
.
link_uuid
.
uuid
)
reply
.
links
.
append
(
link
)
if
context_uuid
==
DEFAULT_CONTEXT_NAME
and
topology_uuid
==
DEFAULT_TOPOLOGY_NAME
:
for
device
in
get_entries
(
self
.
database
,
'
device
'
):
reply
.
devices
.
append
(
device
)
for
link
in
get_entries
(
self
.
database
,
'
link
'
):
reply
.
links
.
append
(
link
)
else
:
# TODO: to be improved; Mock does not associate devices/links to topologies automatically
for
device_id
in
_reply
.
device_ids
:
device
=
get_entry
(
context
,
self
.
database
,
'
device
'
,
device_id
.
device_uuid
.
uuid
)
reply
.
devices
.
append
(
device
)
for
link_id
in
_reply
.
link_ids
:
link
=
get_entry
(
context
,
self
.
database
,
'
link
'
,
link_id
.
link_uuid
.
uuid
)
reply
.
links
.
append
(
link
)
LOGGER
.
info
(
'
[GetTopologyDetails] reply={:s}
'
.
format
(
grpc_message_to_json_string
(
reply
)))
return
reply
...
...
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