Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
LOFAR
Manage
Activity
Members
Labels
Plan
Issues
Wiki
Jira issues
Open Jira
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
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Code review 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
RadioObservatory
LOFAR
Commits
e9dc69fb
Commit
e9dc69fb
authored
5 years ago
by
Jorrit Schaap
Browse files
Options
Downloads
Patches
Plain Diff
SW-818
: use lofar.common.subprocess_utils.check_output_returning_strings to handle cmd output bytes
parent
ced9ce4d
No related branches found
No related tags found
Loading
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
MAC/TBB/lib/tbb_load_firmware.py
+2
-1
2 additions, 1 deletion
MAC/TBB/lib/tbb_load_firmware.py
MAC/TBB/lib/tbb_util.py
+3
-2
3 additions, 2 deletions
MAC/TBB/lib/tbb_util.py
with
5 additions
and
3 deletions
MAC/TBB/lib/tbb_load_firmware.py
+
2
−
1
View file @
e9dc69fb
...
@@ -12,6 +12,7 @@ import subprocess
...
@@ -12,6 +12,7 @@ import subprocess
import
logging
import
logging
from
lofar.mac.tbb.tbb_config
import
supported_modes
,
lcurun_command
,
tbb_command
from
lofar.mac.tbb.tbb_config
import
supported_modes
,
lcurun_command
,
tbb_command
from
lofar.common.lcu_utils
import
translate_user_station_string_into_station_list
from
lofar.common.lcu_utils
import
translate_user_station_string_into_station_list
from
lofar.common.subprocess_utils
import
check_output_returning_strings
def
load_tbb_firmware
(
stations
,
mode
):
def
load_tbb_firmware
(
stations
,
mode
):
logging
.
info
(
'
Loading TBB firmware for mode
\"
%s
\"
'
%
(
mode
))
logging
.
info
(
'
Loading TBB firmware for mode
\"
%s
\"
'
%
(
mode
))
...
@@ -49,7 +50,7 @@ def load_tbb_firmware(stations, mode):
...
@@ -49,7 +50,7 @@ def load_tbb_firmware(stations, mode):
cmd
=
[
tbb_command
,
'
--imageinfo=%s
'
%
str
(
board
)]
cmd
=
[
tbb_command
,
'
--imageinfo=%s
'
%
str
(
board
)]
cmd
=
relay
+
cmd
cmd
=
relay
+
cmd
logging
.
info
(
'
Executing %s
'
%
'
'
.
join
(
cmd
))
logging
.
info
(
'
Executing %s
'
%
'
'
.
join
(
cmd
))
logging
.
info
(
subprocess
.
check_output
(
cmd
))
logging
.
info
(
subprocess
.
check_output
_returning_strings
(
cmd
))
def
parse_args
():
def
parse_args
():
...
...
This diff is collapsed.
Click to expand it.
MAC/TBB/lib/tbb_util.py
+
3
−
2
View file @
e9dc69fb
from
lofar.mac.tbb.tbb_config
import
*
from
lofar.mac.tbb.tbb_config
import
*
from
lxml
import
etree
from
lxml
import
etree
from
lofar.common.cep4_utils
import
*
from
lofar.common.cep4_utils
import
*
from
subprocess
import
check_output
from
lofar.common.subprocess_utils
import
check_output_returning_strings
import
logging
import
logging
logger
=
logging
.
getLogger
(
__name__
)
logger
=
logging
.
getLogger
(
__name__
)
...
@@ -22,7 +23,7 @@ def get_cpu_nodes_running_tbb_datawriter_via_slurm():
...
@@ -22,7 +23,7 @@ def get_cpu_nodes_running_tbb_datawriter_via_slurm():
cmd
=
'''
sacct --name=run-tbbwriter --user=lofarsys -o nodelist%128 -n -s R -X
'''
cmd
=
'''
sacct --name=run-tbbwriter --user=lofarsys -o nodelist%128 -n -s R -X
'''
cmd
=
wrap_command_in_cep4_head_node_ssh_call
(
cmd
)
cmd
=
wrap_command_in_cep4_head_node_ssh_call
(
cmd
)
logger
.
debug
(
'
executing command: %s
'
,
'
'
.
join
(
cmd
))
logger
.
debug
(
'
executing command: %s
'
,
'
'
.
join
(
cmd
))
out
=
check_output
(
cmd
).
strip
()
out
=
check_output
_returning_strings
(
cmd
).
strip
()
logger
.
debug
(
'
out: %s
'
,
out
)
logger
.
debug
(
'
out: %s
'
,
out
)
return
convert_slurm_nodes_string_to_node_number_list
(
out
)
return
convert_slurm_nodes_string_to_node_number_list
(
out
)
...
...
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