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
4959720a
Commit
4959720a
authored
6 months ago
by
Lluis Gifre Renom
Browse files
Options
Downloads
Patches
Plain Diff
Device component:
- Improved procedure to update operational status
parent
244c8a43
No related branches found
Branches containing commit
No related tags found
Tags containing commit
2 merge requests
!294
Release TeraFlowSDN 4.0
,
!282
Resolve "(CTTC) Auto-start telemetry collection when a device endpoint is activated"
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/device/service/DeviceServiceServicerImpl.py
+8
-2
8 additions, 2 deletions
src/device/service/DeviceServiceServicerImpl.py
with
8 additions
and
2 deletions
src/device/service/DeviceServiceServicerImpl.py
+
8
−
2
View file @
4959720a
...
...
@@ -251,8 +251,14 @@ class DeviceServiceServicerImpl(DeviceServiceServicer):
device_id
=
context_client
.
SetDevice
(
device
)
device
=
context_client
.
GetDevice
(
device_id
)
if
request
.
device_operational_status
!=
DeviceOperationalStatusEnum
.
DEVICEOPERATIONALSTATUS_UNDEFINED
:
device
.
device_operational_status
=
request
.
device_operational_status
ztp_service_host
=
get_env_var_name
(
ServiceNameEnum
.
ZTP
,
ENVVAR_SUFIX_SERVICE_HOST
)
environment_variables
=
set
(
os
.
environ
.
keys
())
if
ztp_service_host
in
environment_variables
:
# ZTP component is deployed; accept status updates
if
request
.
device_operational_status
!=
DeviceOperationalStatusEnum
.
DEVICEOPERATIONALSTATUS_UNDEFINED
:
device
.
device_operational_status
=
request
.
device_operational_status
else
:
# ZTP is not deployed; activated during AddDevice and not modified
t4
=
time
.
time
()
# TODO: use of datastores (might be virtual ones) to enable rollbacks
...
...
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