diff --git a/MAC/Deployment/data/StaticMetaData/createFiles b/MAC/Deployment/data/StaticMetaData/createFiles index 30718a9b0b21a27b6f8bf378abe4960f860ea9d9..65f8e576efa2e9deaa04cd7b0bd6b2dd6a866cbd 100755 --- a/MAC/Deployment/data/StaticMetaData/createFiles +++ b/MAC/Deployment/data/StaticMetaData/createFiles @@ -39,13 +39,13 @@ def findIPNumber(stationName): In case the station is not known, it will return -1. """ - localStationName = Popen("hostname -s",shell=True, stdout=PIPE).stdout.readlines()[0].strip()[0:5].lower() + localStationName = Popen("hostname -s",shell=True, stdout=PIPE).stdout.readlines()[0].strip()[0:5].lower().decode("UTF-8") if (localStationName == stationName): command = "hostname -i" output = Popen(command,shell=True, stdout=PIPE).stdout stdout = output.readlines() outline = stdout[0].strip() - outwords = outline.split() + outwords = outline.split().decode("UTF-8") if (len(outwords) != 1): return "-1" else: @@ -56,7 +56,7 @@ def findIPNumber(stationName): output = Popen(command,shell=True, stdout=PIPE).stdout stdout = output.readlines() outline = stdout[0].strip() - outwords = outline.split() + outwords = outline.split().decode("UTF-8") if (len(outwords) < 2): print("Could not find IP for station, assuming 10.150.1.1") return "10.150.1.1" @@ -870,7 +870,7 @@ if __name__ == "__main__": if (sys.argv[1] == "localhost" or sys.argv[1] == "test"): # Find out stationname from command 'hostname -s' - stationName = Popen("hostname -s",shell=True, stdout=PIPE).stdout.readlines()[0].strip()[0:5].lower() + stationName = Popen("hostname -s",shell=True, stdout=PIPE).stdout.readlines()[0].strip()[0:5].lower().decode("UTF-8") if (len(stationName) > 0) : if (os.path.exists("/opt/lofar/etc")): resultDir = "/opt/lofar/etc"