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
786a54f3
Commit
786a54f3
authored
1 year ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Device component:
- Added logs to identify issue
parent
9d2f3119
No related branches found
No related tags found
2 merge requests
!235
Release TeraFlowSDN 3.0
,
!216
Resolve "Automate end-to-end tests and integrate them in CI/CD pipeline"
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/device/service/DeviceServiceServicerImpl.py
+25
-0
25 additions, 0 deletions
src/device/service/DeviceServiceServicerImpl.py
with
25 additions
and
0 deletions
src/device/service/DeviceServiceServicerImpl.py
+
25
−
0
View file @
786a54f3
...
...
@@ -88,10 +88,17 @@ class DeviceServiceServicerImpl(DeviceServiceServicer):
# update device_uuid to honor UUID provided by Context
device_uuid
=
device
.
device_id
.
device_uuid
.
uuid
device_name
=
device
.
name
t2
=
time
.
time
()
LOGGER
.
warning
(
'
[AddDevice] before add_alias {:s} {:s}
'
.
format
(
str
(
device_uuid
),
str
(
device_name
)))
self
.
mutex_queues
.
add_alias
(
device_uuid
,
device_name
)
LOGGER
.
warning
(
'
[AddDevice] after add_alias {:s} {:s}
'
.
format
(
str
(
device_uuid
),
str
(
device_name
)))
LOGGER
.
warning
(
'
[AddDevice] before wait_my_turn {:s}
'
.
format
(
str
(
device_uuid
)))
self
.
mutex_queues
.
wait_my_turn
(
device_uuid
)
LOGGER
.
warning
(
'
[AddDevice] after wait_my_turn {:s}
'
.
format
(
str
(
device_uuid
)))
t3
=
time
.
time
()
try
:
driver
:
_Driver
=
get_driver
(
self
.
driver_instance_cache
,
device
)
...
...
@@ -202,7 +209,9 @@ class DeviceServiceServicerImpl(DeviceServiceServicer):
return
device_id
finally
:
LOGGER
.
warning
(
'
[AddDevice] before signal_done {:s}
'
.
format
(
str
(
device_uuid
)))
self
.
mutex_queues
.
signal_done
(
device_uuid
)
LOGGER
.
warning
(
'
[AddDevice] after signal_done {:s}
'
.
format
(
str
(
device_uuid
)))
@safe_and_metered_rpc_method
(
METRICS_POOL
,
LOGGER
)
def
ConfigureDevice
(
self
,
request
:
Device
,
context
:
grpc
.
ServicerContext
)
->
DeviceId
:
...
...
@@ -210,7 +219,9 @@ class DeviceServiceServicerImpl(DeviceServiceServicer):
device_id
=
request
.
device_id
device_uuid
=
device_id
.
device_uuid
.
uuid
LOGGER
.
warning
(
'
[ConfigureDevice] before wait_my_turn {:s}
'
.
format
(
str
(
device_uuid
)))
self
.
mutex_queues
.
wait_my_turn
(
device_uuid
)
LOGGER
.
warning
(
'
[ConfigureDevice] after wait_my_turn {:s}
'
.
format
(
str
(
device_uuid
)))
t1
=
time
.
time
()
try
:
context_client
=
ContextClient
()
...
...
@@ -294,13 +305,17 @@ class DeviceServiceServicerImpl(DeviceServiceServicer):
return
device_id
finally
:
LOGGER
.
warning
(
'
[ConfigureDevice] before signal_done {:s}
'
.
format
(
str
(
device_uuid
)))
self
.
mutex_queues
.
signal_done
(
device_uuid
)
LOGGER
.
warning
(
'
[ConfigureDevice] after signal_done {:s}
'
.
format
(
str
(
device_uuid
)))
@safe_and_metered_rpc_method
(
METRICS_POOL
,
LOGGER
)
def
DeleteDevice
(
self
,
request
:
DeviceId
,
context
:
grpc
.
ServicerContext
)
->
Empty
:
device_uuid
=
request
.
device_uuid
.
uuid
LOGGER
.
warning
(
'
[DeleteDevice] before wait_my_turn {:s}
'
.
format
(
str
(
device_uuid
)))
self
.
mutex_queues
.
wait_my_turn
(
device_uuid
)
LOGGER
.
warning
(
'
[DeleteDevice] after wait_my_turn {:s}
'
.
format
(
str
(
device_uuid
)))
try
:
context_client
=
ContextClient
()
device
=
get_device
(
...
...
@@ -315,13 +330,17 @@ class DeviceServiceServicerImpl(DeviceServiceServicer):
context_client
.
RemoveDevice
(
request
)
return
Empty
()
finally
:
LOGGER
.
warning
(
'
[DeleteDevice] before signal_done {:s}
'
.
format
(
str
(
device_uuid
)))
self
.
mutex_queues
.
signal_done
(
device_uuid
)
LOGGER
.
warning
(
'
[DeleteDevice] after signal_done {:s}
'
.
format
(
str
(
device_uuid
)))
@safe_and_metered_rpc_method
(
METRICS_POOL
,
LOGGER
)
def
GetInitialConfig
(
self
,
request
:
DeviceId
,
context
:
grpc
.
ServicerContext
)
->
DeviceConfig
:
device_uuid
=
request
.
device_uuid
.
uuid
LOGGER
.
warning
(
'
[GetInitialConfig] before wait_my_turn {:s}
'
.
format
(
str
(
device_uuid
)))
self
.
mutex_queues
.
wait_my_turn
(
device_uuid
)
LOGGER
.
warning
(
'
[GetInitialConfig] after wait_my_turn {:s}
'
.
format
(
str
(
device_uuid
)))
try
:
context_client
=
ContextClient
()
device
=
get_device
(
...
...
@@ -344,7 +363,9 @@ class DeviceServiceServicerImpl(DeviceServiceServicer):
return
device_config
finally
:
LOGGER
.
warning
(
'
[GetInitialConfig] before signal_done {:s}
'
.
format
(
str
(
device_uuid
)))
self
.
mutex_queues
.
signal_done
(
device_uuid
)
LOGGER
.
warning
(
'
[GetInitialConfig] after signal_done {:s}
'
.
format
(
str
(
device_uuid
)))
@safe_and_metered_rpc_method
(
METRICS_POOL
,
LOGGER
)
def
MonitorDeviceKpi
(
self
,
request
:
MonitoringSettings
,
context
:
grpc
.
ServicerContext
)
->
Empty
:
...
...
@@ -362,7 +383,9 @@ class DeviceServiceServicerImpl(DeviceServiceServicer):
raise
OperationFailedException
(
'
MonitorDeviceKpi
'
,
extra_details
=
msg
)
device_uuid
=
kpi_details
[
0
]
LOGGER
.
warning
(
'
[MonitorDeviceKpi] before wait_my_turn {:s}
'
.
format
(
str
(
device_uuid
)))
self
.
mutex_queues
.
wait_my_turn
(
device_uuid
)
LOGGER
.
warning
(
'
[MonitorDeviceKpi] after wait_my_turn {:s}
'
.
format
(
str
(
device_uuid
)))
try
:
context_client
=
ContextClient
()
device
=
get_device
(
...
...
@@ -381,4 +404,6 @@ class DeviceServiceServicerImpl(DeviceServiceServicer):
return
Empty
()
finally
:
LOGGER
.
warning
(
'
[MonitorDeviceKpi] before signal_done {:s}
'
.
format
(
str
(
device_uuid
)))
self
.
mutex_queues
.
signal_done
(
device_uuid
)
LOGGER
.
warning
(
'
[MonitorDeviceKpi] after signal_done {:s}
'
.
format
(
str
(
device_uuid
)))
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