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

Fix Virtual Machine Import, ensure that the vCPU Attribute is an integer #86

Merged
merged 2 commits into from
Feb 15, 2023
Merged

Fix Virtual Machine Import, ensure that the vCPU Attribute is an integer #86

merged 2 commits into from
Feb 15, 2023

Conversation

sirtux
Copy link
Contributor

@sirtux sirtux commented Feb 9, 2023

Closes #85

When importing the data, the vCPU value, which is due to the json a string, is first casted to a float, and than to an int.

Copy link
Contributor

@glennmatthews glennmatthews left a comment

Choose a reason for hiding this comment

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

Looks reasonable as a workaround for a feature that was added in NetBox 2.11. Longer-term it might be desirable to port that feature to Nautobot :-).

My only suggestion here might be to add a logger.warning call in the case where this results in rounding or data loss (e.g. converting a NetBox 0.5 value to a Nautobot 0)

@sirtux
Copy link
Contributor Author

sirtux commented Feb 9, 2023

Hmm, not sure if a warning makes much sense, since as far as I know, there is no virtualization solution which allows assignment of partial cores, it should always be an integer, so it believe nautobot is completly right here.

@glennmatthews glennmatthews merged commit 63a74cd into nautobot:develop Feb 15, 2023
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.

VirtualMachine Model Field VCPU is Decimal in Netbox, but int in Nautobot
2 participants