diff --git a/MAC/Deployment/data/StaticMetaData/createFiles b/MAC/Deployment/data/StaticMetaData/createFiles index 65f8e576efa2e9deaa04cd7b0bd6b2dd6a866cbd..339f64e38476bf3bba5ed4bf5307e37128070ca3 100755 --- a/MAC/Deployment/data/StaticMetaData/createFiles +++ b/MAC/Deployment/data/StaticMetaData/createFiles @@ -44,8 +44,8 @@ def findIPNumber(stationName): command = "hostname -i" output = Popen(command,shell=True, stdout=PIPE).stdout stdout = output.readlines() - outline = stdout[0].strip() - outwords = outline.split().decode("UTF-8") + outline = stdout[0].strip().decode("UTF-8") + outwords = outline.split() if (len(outwords) != 1): return "-1" else: @@ -55,8 +55,8 @@ def findIPNumber(stationName): command = "getent hosts "+stationName+"C" output = Popen(command,shell=True, stdout=PIPE).stdout stdout = output.readlines() - outline = stdout[0].strip() - outwords = outline.split().decode("UTF-8") + outline = stdout[0].strip().decode("UTF-8") + outwords = outline.split() if (len(outwords) < 2): print("Could not find IP for station, assuming 10.150.1.1") return "10.150.1.1" @@ -466,7 +466,7 @@ def createRSPDriverFile(resultDir, stationName, dataDir,int_local,is_Cobalt): RSPconfig = RSPconfig.replace(repl_str, ethport) outFile = os.open(dataDir+"/RSPDriver.conf.tmp", os.O_RDWR|os.O_CREAT|os.O_TRUNC) - os.write(outFile, RSPconfig) + os.write(outFile, RSPconfig.encode()) os.close(outFile) @@ -604,7 +604,7 @@ def createRSPDriverFile_Test(resultDir, stationName, dataDir, alias): RSPconfig = RSPconfig.replace(repl_str, ethport) outFile = os.open(dataDir+"/RSPDriver.conf.tmp", os.O_RDWR|os.O_CREAT|os.O_TRUNC) - os.write(outFile, RSPconfig) + os.write(outFile, RSPconfig.encode()) os.close(outFile) # An ugly way to get rid of all lines in the template file that are not @@ -693,7 +693,7 @@ def createTBBDriverFile(resultDir, stationName, dataDir): TBBconfig = TBBconfig.replace(repl_str, ethport) outFile = os.open(dataDir+"/TBBDriver.conf.tmp", os.O_RDWR|os.O_CREAT|os.O_TRUNC) - os.write(outFile, TBBconfig) + os.write(outFile, TBBconfig.encode()) os.close(outFile) # An ugly way to get rid of all lines in the template file that are not # filled yet. @@ -723,7 +723,7 @@ def createRemoteStationFile(resultDir, stationName, dataDir): RSconfig = RSconfig.replace("@AARTFAAC@", Aartfaac) outFile = os.open(resultDir+"/RemoteStation.conf", os.O_RDWR|os.O_CREAT|os.O_TRUNC) - os.write(outFile, RSconfig) + os.write(outFile, RSconfig.encode()) os.close(outFile) @@ -839,7 +839,7 @@ def createHardwareMonitorFile(resultDir, stationName, dataDir, last_ip="3"): HWMconfig = HWMconfig.replace("@STATION@", stationName.upper()) HWMconfig = HWMconfig.replace("@IP_ENV_CONTR@", HWMip) outFile = os.open(resultDir+"/HardwareMonitor.conf", os.O_RDWR|os.O_CREAT|os.O_TRUNC) - os.write(outFile, HWMconfig) + os.write(outFile, HWMconfig.encode()) os.close(outFile)