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

linode: support cache in Linode dynamic inventory #4179

Merged

Conversation

wbh1
Copy link
Contributor

@wbh1 wbh1 commented Feb 9, 2022

SUMMARY

This PR adds support for caching results from the Linode dynamic inventory plugin.

Because the Linode API module uses non-serializable custom classes, I store the raw JSON response from the API in the cache and recreate the Instance objects when reading from cache.

ISSUE TYPE
  • Feature Pull Request
COMPONENT NAME

linode

ADDITIONAL INFORMATION

I've confirmed that the inventory works as expected both with cache disabled and with it enabled.

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added cloud feature This issue/PR relates to a feature request inventory inventory plugin plugins plugin (any type) labels Feb 9, 2022
@ansibullbot

This comment was marked as outdated.

@ansibullbot ansibullbot added ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Feb 9, 2022
@wbh1 wbh1 force-pushed the feat/linode_inventory_cache branch from a7c3c3a to 9f855d3 Compare February 9, 2022 19:42
@ansibullbot ansibullbot removed ci_verified Push fixes to PR branch to re-run CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR labels Feb 9, 2022
@felixfontein felixfontein added backport-4 check-before-release PR will be looked at again shortly before release and merged if possible. labels Feb 10, 2022
Copy link
Collaborator

@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution! Here are a first few comments.

plugins/inventory/linode.py Show resolved Hide resolved
@wbh1 wbh1 force-pushed the feat/linode_inventory_cache branch from 9f855d3 to 7c7a0b9 Compare February 10, 2022 15:49
@ansibullbot ansibullbot added needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR and removed needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR needs_ci This PR requires CI testing to be performed. Please close and re-open this PR to trigger CI labels Feb 10, 2022
plugins/inventory/linode.py Show resolved Hide resolved
plugins/inventory/linode.py Outdated Show resolved Hide resolved
plugins/inventory/linode.py Outdated Show resolved Hide resolved
@wbh1 wbh1 force-pushed the feat/linode_inventory_cache branch from 7c7a0b9 to 9e58b29 Compare February 16, 2022 16:24
@felixfontein
Copy link
Collaborator

Looks good to me! If nobody complains, I'll merge it this weekend.

@felixfontein felixfontein merged commit f6e0693 into ansible-collections:main Feb 18, 2022
@patchback
Copy link

patchback bot commented Feb 18, 2022

Backport to stable-4: 💚 backport PR created

✅ Backport PR branch: patchback/backports/stable-4/f6e0693e861e8864b2f49848e48b1759335674f1/pr-4179

Backported as #4234

🤖 @patchback
I'm built with octomachinery and
my source is open — https://github.com/sanitizers/patchback-github-app.

@felixfontein felixfontein removed the check-before-release PR will be looked at again shortly before release and merged if possible. label Feb 18, 2022
patchback bot pushed a commit that referenced this pull request Feb 18, 2022
@felixfontein
Copy link
Collaborator

@wbh1 thanks for your contribution!

felixfontein pushed a commit that referenced this pull request Feb 18, 2022
(cherry picked from commit f6e0693)

Co-authored-by: Will Hegedus <whegedus@linode.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cloud feature This issue/PR relates to a feature request inventory inventory plugin plugins plugin (any type)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants