Skip to content
This repository has been archived by the owner on Dec 1, 2023. It is now read-only.

Add support for Device Lifecycle Plugin #101

Merged
merged 23 commits into from
Oct 18, 2022
Merged

Add support for Device Lifecycle Plugin #101

merged 23 commits into from
Oct 18, 2022

Conversation

jdrew82
Copy link
Contributor

@jdrew82 jdrew82 commented Oct 17, 2022

This PR adds support for integrating with the Device Lifecycle plug-in requested in #87. It determines if the plug-in is installed by trying to import the SoftwareLCM model. If it can, it's determined to be installed and will thus create a Software Version and create a RelationshipAssocation between the Device and that Version. If the plug-in isn't found, it'll resort to the CustomField created from the tag. There's also a small fix for the platform bug described in #100.

… create/update

This should fix Issue #100. The Platform should not be the device model. It should be one for all Device Types and should be the Arista EOS platform. This fixes documentation and removes the errneous creation/update from tags.
@jdrew82 jdrew82 requested a review from qduk as a code owner October 17, 2022 16:22
Meant to put this on Platform.
…form creation

Also removed verify_manufacturer method as it's no longer needed.
…and #95.

I found that in an update run that the Nautobot adapter was returning no Devices. In my investigation it appears it was being caught in the try/except block for some AttributeError. I've refactored this to narrow down the block to just CustomField loading and have some logging if encountered.
The indentation was wrong causing the CF to be loaded repeatedly causing an ObjectAlreadyExists to be thrown.
@jdrew82
Copy link
Contributor Author

jdrew82 commented Oct 18, 2022

I've ended up including some fixes for #93, #95, and #102 as I found that during an update run of the import Job that devices weren't being loaded during the Nautobot adapter load step. This appears to have been due to an AttributeError exception on the dev.device_type.name being used when it should be dev.device_type.model. As the try/except block encompassed the entire load method it masked various bugs. I believe I've fixed all the various bugs in the load method though.

Copy link
Contributor

@qduk qduk left a comment

Choose a reason for hiding this comment

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

LGTM!

@qduk qduk merged commit b6deded into nautobot:develop Oct 18, 2022
@jdrew82 jdrew82 deleted the dlc_support branch October 18, 2022 19:38
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants