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

SW-567: minor bug fix in hostname2stationname conversion

parent c015100d
No related branches found
No related tags found
No related merge requests found
......@@ -79,7 +79,7 @@ def get_current_stations(station_group='today', as_host_names=True):
station_hostnames.append(station_hostname)
if as_host_names:
logger.info("stations in group '%s': %s", station_group, ' '.join(station_hostnames))
logger.info("station hostnames in group '%s': %s", station_group, ' '.join(station_hostnames))
return station_hostnames
station_names = [hostname2stationname(x) for x in station_hostnames]
......@@ -98,7 +98,7 @@ def stationname2hostname(station_name):
def hostname2stationname(station_hostname):
'''Convert a lcu hostname to a parset-like station name , like cs001c or cs001c.control.lofar to CS001'''
# assume a hostname is encoded as stationname in lowercase with a c appended, like cs001c for CS001
return station_name.split('.')[0].strip()[-1].upper()
return station_hostname.split('.')[0].strip()[:-1].upper()
def get_stations_rcu_mode(stations=None):
'''
......
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