Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adding scipion Field and replacing architecture by CPUFlags #957

Merged
merged 15 commits into from
Dec 10, 2024
26 changes: 11 additions & 15 deletions installer/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,18 +241,14 @@ def __getLogTail() -> Optional[str]:



def __getCPUFlags(lscpu_output) -> str:
lines = lscpu_output.splitlines()
flags = []
capture = False

for line in lines:
if "Flags:" in line:
capture = True
flags.append(line.split("Flags:")[1].strip())
elif capture:
if line.startswith(" "):
flags.append(line.strip())
else:
break
return " ".join(flags)
def __getCPUFlags() -> str:
"""
### This function returns a string with the flags provided by lscpu.
"""
log = []
returnCode, outputStr = runJob('lscpu | grep Flags', logOutput=log)
if returnCode == 0:
flagsCPU = outputStr.replace('Flags:', '').replace(' ', '')
albertmena marked this conversation as resolved.
Show resolved Hide resolved
return flagsCPU
else:
albertmena marked this conversation as resolved.
Show resolved Hide resolved
return'Unknow'