Skip to content

Conversation

@leonardowitt
Copy link

I'm opening it as a draft since I didn't implement the device revision support to Windows.

Copy link
Owner

@jaypipes jaypipes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks great, Leonardo, thank you for the contribution!

There's no need to include Windows support in this particular PR, however one thing I would ask is that you actually submit two PRs, one for the fix to the disk's NUMA Node ID collection and the other PR containing the new disk Revision field. That way, if we need to revert one of the fixes/features, we don't need to revert everything.

Best,
-jay

if nodeContents, err := ioutil.ReadFile(filepath.Join(paths.SysBlock, partial, "numa_node")); err != nil {
if nodeInt, err := strconv.Atoi(string(nodeContents)); err != nil {
if nodeContents, err := ioutil.ReadFile(filepath.Join(paths.SysBlock, partial, "numa_node")); err == nil {
if nodeInt, err := strconv.Atoi(string(nodeContents)); err == nil {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch, Leonardo!

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! but this would deserve a separate PR

if nodeContents, err := ioutil.ReadFile(filepath.Join(paths.SysBlock, partial, "numa_node")); err != nil {
if nodeInt, err := strconv.Atoi(string(nodeContents)); err != nil {
if nodeContents, err := ioutil.ReadFile(filepath.Join(paths.SysBlock, partial, "numa_node")); err == nil {
if nodeInt, err := strconv.Atoi(string(nodeContents)); err == nil {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed! but this would deserve a separate PR

return strings.TrimSpace(string(contents))
}

func diskRevision(paths *linuxpath.Paths, disk string) string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it's ok to add support for linux first and add a TODO for windows/mac

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants