-
Notifications
You must be signed in to change notification settings - Fork 184
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
CNF-13015: Add helper function to run lscpu
and parse result using regex parameters
#638
CNF-13015: Add helper function to run lscpu
and parse result using regex parameters
#638
Conversation
fontivan
commented
Jun 10, 2024
- This is similar to the cpuinfo function that reads from /proc/cpuinfo
- Unfortunately that function was insufficient for our needs as we need to identify both the Vendor and Architecture reliably
…regex parameters - This is similar to the cpuinfo function that reads from /proc/cpuinfo - Unfortunately that function was insufficient for our needs as we need to identify both the Vendor and Architecture reliably
lscpu
and parse result using egex parameterslscpu
and parse result using regex parameters
if not super(lscpu_check, self).execute(args): | ||
return None | ||
# Stdout is the 2nd result from the execute call | ||
_, lscpu = self._cmd.execute("lscpu") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could also check the return code here and potentially raise an exception though I'm not sure if its required
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it maybe OK as it is. You should see the error output in the TuneD log and in case of error it will substitute empty string.
Thanks, I think we can have this function. I am now @ DevConf, I will handle this during next week. |
@yarda any update for this? |
if not super(lscpu_check, self).execute(args): | ||
return None | ||
# Stdout is the 2nd result from the execute call | ||
_, lscpu = self._cmd.execute("lscpu") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it maybe OK as it is. You should see the error output in the TuneD log and in case of error it will substitute empty string.