diff --git a/LCS/PyCommon/lcu_utils.py b/LCS/PyCommon/lcu_utils.py index ae39ec0ef21e29e381e585d61c47adc940b0daed..e4e3abe0c7373142f9c9cf1ce1c30a51b25a9c37 100644 --- a/LCS/PyCommon/lcu_utils.py +++ b/LCS/PyCommon/lcu_utils.py @@ -16,7 +16,7 @@ # with the LOFAR software suite. If not, see <http://www.gnu.org/licenses/>. from lofar.common.ssh_utils import ssh_cmd_list -from lofar.common.subprocess_utils import execute_in_parallel, wrap_composite_command +from lofar.common.subprocess_utils import execute_in_parallel, wrap_composite_command, communicate_returning_strings from subprocess import Popen, PIPE import os @@ -100,7 +100,7 @@ def get_current_stations(station_group='today', as_host_names=True): cmd = wrap_command_in_lcu_head_node_ssh_call(cmd) logger.debug('executing cmd: %s', ' '.join(cmd)) proc = Popen(cmd, stdout=PIPE, stderr=PIPE) - out, err = proc.communicate() + out, err = communicate_returning_strings(proc) if proc.returncode != 0: raise LCURuntimeError("Could not fetch stations.txt file. sdterr=%s" % (err, )) @@ -161,7 +161,7 @@ def get_stations_rcu_mode(stations=None): result = {} for station, proc in list(procs.items()): - out, err = proc.communicate() + out, err = communicate_returning_strings(proc) if proc.returncode != 0: logger.warning("Could not determine rcu mode for station %s. sdterr=%s" % (station, err)) @@ -213,7 +213,7 @@ def get_station_cable_delays(stations=None): # wait for all fetching procs to finish... #TODO: add timeout? for station, proc in list(cable_delay_procs.items()): - out, err = proc.communicate() + out, err = communicate_returning_strings(proc) if proc.returncode != 0: logger.warning("Could not fetch cable_delay file for station %s. stderr=%s", station, err) @@ -331,7 +331,7 @@ def get_station_calibration_tables(stations=None, antenna_set_and_filter=None, t # wait for all fetching procs to finish... #TODO: add timeout? for station, proc in list(caltable_procs.items()): - out, err = proc.communicate() + out, err = communicate_returning_strings(proc) if proc.returncode != 0: logger.warning("Could not fetch calibration table for station %s. stderr=%s", station, err)