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
bd7f1d0a
Commit
bd7f1d0a
authored
2 years ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
WebUI component:
- testing session management
parent
73e0356b
No related branches found
No related tags found
2 merge requests
!54
Release 2.0.0
,
!34
Context Scalability extensions using CockroachDB + Removal of Stateful database inside Device + other
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/webui/service/main/routes.py
+6
-4
6 additions, 4 deletions
src/webui/service/main/routes.py
with
6 additions
and
4 deletions
src/webui/service/main/routes.py
+
6
−
4
View file @
bd7f1d0a
...
@@ -32,7 +32,7 @@ device_client = DeviceClient()
...
@@ -32,7 +32,7 @@ device_client = DeviceClient()
service_client
=
ServiceClient
()
service_client
=
ServiceClient
()
slice_client
=
SliceClient
()
slice_client
=
SliceClient
()
logger
=
logging
.
getLogger
(
__name__
)
LOGGER
=
logging
.
getLogger
(
__name__
)
def
process_descriptors
(
descriptors
):
def
process_descriptors
(
descriptors
):
try
:
try
:
...
@@ -74,7 +74,9 @@ def home():
...
@@ -74,7 +74,9 @@ def home():
context_topology_uuid
=
context_topology_form
.
context_topology
.
data
context_topology_uuid
=
context_topology_form
.
context_topology
.
data
if
len
(
context_topology_uuid
)
>
0
:
if
len
(
context_topology_uuid
)
>
0
:
b64_values
=
context_topology_uuid
.
split
(
'
,
'
)
b64_values
=
context_topology_uuid
.
split
(
'
,
'
)
LOGGER
.
warning
(
'
b64_values={:s}
'
.
format
(
str
(
b64_values
)))
raw_values
=
[
base64
.
b64decode
(
v
.
encode
(
'
utf-8
'
)).
decode
(
'
utf-8
'
)
for
v
in
b64_values
]
raw_values
=
[
base64
.
b64decode
(
v
.
encode
(
'
utf-8
'
)).
decode
(
'
utf-8
'
)
for
v
in
b64_values
]
LOGGER
.
warning
(
'
raw_values={:s}
'
.
format
(
str
(
raw_values
)))
context_uuid
,
context_name
,
topology_uuid
,
topology_name
=
raw_values
context_uuid
,
context_name
,
topology_uuid
,
topology_name
=
raw_values
session
[
'
context_topology_uuid
'
]
=
context_topology_uuid
session
[
'
context_topology_uuid
'
]
=
context_topology_uuid
session
[
'
context_uuid
'
]
=
context_uuid
session
[
'
context_uuid
'
]
=
context_uuid
...
@@ -103,7 +105,7 @@ def home():
...
@@ -103,7 +105,7 @@ def home():
process_descriptors
(
descriptor_form
.
descriptors
)
process_descriptors
(
descriptor_form
.
descriptors
)
return
redirect
(
url_for
(
"
main.home
"
))
return
redirect
(
url_for
(
"
main.home
"
))
except
Exception
as
e
:
# pylint: disable=broad-except
except
Exception
as
e
:
# pylint: disable=broad-except
logger
.
exception
(
'
Descriptor load failed
'
)
LOGGER
.
exception
(
'
Descriptor load failed
'
)
flash
(
f
'
Descriptor load failed: `
{
str
(
e
)
}
`
'
,
'
danger
'
)
flash
(
f
'
Descriptor load failed: `
{
str
(
e
)
}
`
'
,
'
danger
'
)
finally
:
finally
:
context_client
.
close
()
context_client
.
close
()
...
@@ -144,7 +146,7 @@ def topology():
...
@@ -144,7 +146,7 @@ def topology():
if
link
.
link_id
.
link_uuid
.
uuid
not
in
topo_link_uuids
:
continue
if
link
.
link_id
.
link_uuid
.
uuid
not
in
topo_link_uuids
:
continue
if
len
(
link
.
link_endpoint_ids
)
!=
2
:
if
len
(
link
.
link_endpoint_ids
)
!=
2
:
str_link
=
grpc_message_to_json_string
(
link
)
str_link
=
grpc_message_to_json_string
(
link
)
logger
.
warning
(
'
Unexpected link with len(endpoints) != 2: {:s}
'
.
format
(
str_link
))
LOGGER
.
warning
(
'
Unexpected link with len(endpoints) != 2: {:s}
'
.
format
(
str_link
))
continue
continue
links
.
append
({
links
.
append
({
'
id
'
:
link
.
link_id
.
link_uuid
.
uuid
,
'
id
'
:
link
.
link_id
.
link_uuid
.
uuid
,
...
@@ -154,7 +156,7 @@ def topology():
...
@@ -154,7 +156,7 @@ def topology():
return
jsonify
({
'
devices
'
:
devices
,
'
links
'
:
links
})
return
jsonify
({
'
devices
'
:
devices
,
'
links
'
:
links
})
except
:
except
:
logger
.
exception
(
'
Error retrieving topology
'
)
LOGGER
.
exception
(
'
Error retrieving topology
'
)
finally
:
finally
:
context_client
.
close
()
context_client
.
close
()
...
...
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