Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.toolbox
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kirill Smelkov
slapos.toolbox
Commits
a16a4e1d
Commit
a16a4e1d
authored
Oct 09, 2023
by
Kirill Smelkov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
.
parent
de7564fb
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
4 deletions
+6
-4
slapos/promise/plugin/check_sdr_busy.py
slapos/promise/plugin/check_sdr_busy.py
+6
-4
No files found.
slapos/promise/plugin/check_sdr_busy.py
View file @
a16a4e1d
...
@@ -16,22 +16,24 @@ class RunPromise(GenericPromise):
...
@@ -16,22 +16,24 @@ class RunPromise(GenericPromise):
testing
=
self
.
getConfig
(
'testing'
)
==
"True"
testing
=
self
.
getConfig
(
'testing'
)
==
"True"
sdr
=
self
.
getConfig
(
'sdr'
)
sdr
=
self
.
getConfig
(
'sdr'
)
sdr_dev
=
self
.
getConfig
(
'sdr_dev'
)
dma_chan
=
self
.
getConfig
(
'dma_chan'
)
sdr_devchan
=
"/dev/sdr%s@%s"
%
(
sdr_dev
,
dma_chan
)
self
.
logger
.
error
(
'HELLO WORLD'
)
if
testing
:
if
testing
:
self
.
logger
.
info
(
"skipping promise"
)
self
.
logger
.
info
(
"skipping promise"
)
return
return
try
:
try
:
out
=
subprocess
.
check_output
([
out
=
subprocess
.
check_output
([
sdr
+
'/sdr_util'
,
'-c'
,
'0'
,
'version'
],
stderr
=
subprocess
.
STDOUT
)
sdr
+
'/sdr_util'
,
'-c'
,
sdr_dev
,
'-d'
,
dma_chan
,
'version'
],
stderr
=
subprocess
.
STDOUT
)
except
subprocess
.
CalledProcessError
as
e
:
except
subprocess
.
CalledProcessError
as
e
:
if
e
.
returncode
==
1
and
\
if
e
.
returncode
==
1
and
\
(
"DMA channel is already opened"
in
e
.
output
.
decode
()
or
\
(
"DMA channel is already opened"
in
e
.
output
.
decode
()
or
\
"Device or resource busy"
in
e
.
output
.
decode
()):
"Device or resource busy"
in
e
.
output
.
decode
()):
self
.
logger
.
info
(
"eNB is using
/dev/sdr0"
)
self
.
logger
.
info
(
"eNB is using
%s"
,
sdr_devchan
)
return
return
self
.
logger
.
error
(
"eNB is not using
/dev/sdr0"
)
self
.
logger
.
error
(
"eNB is not using
%s"
,
sdr_devchan
)
def
test
(
self
):
def
test
(
self
):
"""
"""
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment