-
Notifications
You must be signed in to change notification settings - Fork 3
Add logic for importing devices from C3 #118
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
Conversation
omar-selo
left a comment
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.
Some small comments but a couple a bit more involved. Would it not be better to extend the existing certificates endpoint on C3 to include devices. And do we want device instances or not
omar-selo
left a comment
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.
LGTM! thanks for addressing my comments
This PR closes C3-649. It depends on https://github.com/canonical/hexr/pull/307 and uses the endpoint defined there
Here we introduce the Device model and the M2M relationship between it and the Report model to reflect the structure that we have in C3.
The importer logic adds a new device only if another device with the same vendor, name, subsystem, bus, version, and category doesn't exist. It was done this way to avoid populating duplicates but keeping as much information as we need to identify a device
There also were added two tests: