Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
tamalero
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
CMS ETL Electronics
tamalero
Commits
6058a1ca
Commit
6058a1ca
authored
1 year ago
by
Daniel Spitzbart
Browse files
Options
Downloads
Patches
Plain Diff
check if controlhub is running if problem with KCU connection is observed
parent
eb9e6ecf
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!99
Implementing auto-threshold scan
Pipeline
#6390592
passed
1 year ago
Stage: greeting
Stage: run
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tamalero/utils.py
+18
-0
18 additions, 0 deletions
tamalero/utils.py
with
18 additions
and
0 deletions
tamalero/utils.py
+
18
−
0
View file @
6058a1ca
...
@@ -319,9 +319,27 @@ def get_kcu(kcu_address, control_hub=True, host='localhost', verbose=False):
...
@@ -319,9 +319,27 @@ def get_kcu(kcu_address, control_hub=True, host='localhost', verbose=False):
adr_table
=
"
address_table/generic/etl_test_fw.xml
"
)
adr_table
=
"
address_table/generic/etl_test_fw.xml
"
)
break
break
except
uhal
.
exception
or
uhal
.
_core
.
exception
:
except
uhal
.
exception
or
uhal
.
_core
.
exception
:
if
control_hub
:
# we could be checking if control hub is running earlier, but since the control hub path is hardcoded
# I only want to do it if really necessary. if controlhub is running happily from another directory, that's fine too
try
:
control_hub_running
=
os
.
popen
(
"
/opt/cactus/bin/controlhub_status
"
).
readlines
()[
0
].
count
(
"
ControlHub is up
"
)
except
IndexError
:
control_hub_running
=
False
print
(
f
"
Trying to run using controlhub, but it seems to not be installed in /opt/cactus/bin/
"
)
if
control_hub_running
:
# if control hub is running, try again to establish a connection
pass
else
:
print
(
"
Controlhub is not running. Start it with: /opt/cactus/bin/controlhub_start
"
)
print
(
"
Exiting.
"
)
return
0
trycnt
+=
1
trycnt
+=
1
time
.
sleep
(
1
)
time
.
sleep
(
1
)
if
(
trycnt
>
10
):
if
(
trycnt
>
10
):
if
control_hub
:
print
(
"
controlhub status:
"
,
"
running
"
if
control_hub_running
else
"
not running
"
)
print
(
"
Could not establish connection with KCU. Exiting.
"
)
print
(
"
Could not establish connection with KCU. Exiting.
"
)
return
0
return
0
...
...
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