File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed
src/DIRAC/WorkloadManagementSystem/JobWrapper Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -968,10 +968,17 @@ def getNodeInformation(self):
968
968
result ["Memory(kB)" ] = int (psutil .virtual_memory ()[1 ] / 1024 )
969
969
result ["LocalAccount" ] = getpass .getuser ()
970
970
971
- with open ("/proc/cpuinfo" , "r" ) as cpuinfo :
972
- info = cpuinfo .readlines ()
973
- result ["ModelName" ] = info [4 ].split (":" )[1 ].replace (" " , "" ).replace ("\n " , "" )
974
- result ["CacheSize(kB)" ] = [x .strip ().split (":" )[1 ] for x in info if "cache size" in x ][0 ].strip ()
971
+ if os .path .exists ("/proc/cpuinfo" ):
972
+ with open ("/proc/cpuinfo" , "r" ) as cpuinfo :
973
+ info = cpuinfo .readlines ()
974
+ try :
975
+ result ["ModelName" ] = info [4 ].split (":" )[1 ].replace (" " , "" ).replace ("\n " , "" )
976
+ except IndexError :
977
+ pass
978
+ try :
979
+ result ["CacheSize(kB)" ] = [x .strip ().split (":" )[1 ] for x in info if "cache size" in x ][0 ].strip ()
980
+ except IndexError :
981
+ pass
975
982
976
983
return result
977
984
You can’t perform that action at this time.
0 commit comments