Skip to content
Snippets Groups Projects
Commit e9dc69fb authored by Jorrit Schaap's avatar Jorrit Schaap
Browse files

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
...@@ -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():
......
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)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment