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: Do not update VM Computer asset if denied by rules #18940

Open
wants to merge 5 commits into
base: 10.0/bugfixes
Choose a base branch
from

Conversation

eduardomozart
Copy link
Contributor

@eduardomozart eduardomozart commented Feb 6, 2025

Checklist before requesting a review

Please delete options that are not relevant.

  • I have read the CONTRIBUTING document.
  • I have performed a self-review of my code.
  • I have added tests that prove my fix is effective or that my feature works.
  • This change requires a documentation update.

Description

  • It fixes # (issue number, if applicable)
  • Here is a brief description of what this PR does

Hello,
Since #18932 hasn't been approved, there's no reliable way to avoid ESX inventory override the inventory of VMs made with GLPI-Agent installed locally. I use ESX inventory because some machines do not allow the GLPI-Agent be installed locally. The only way to filter those machines is using the "Model" field, since ESX inventory do not provide them, but GLPI-Agent does, so I created the following filter rules:

Image

It denies the importing of assets with no "Model" field is already present but is missing on inventory data, but that wasn't working as expected and the local GLPI-Agent data was being overriden by ESX inventory anyway. It happens because GLPI only validates the rules when adding a VM (as can be seen on the same file edited on this commit), but not for update. Now it also checks the rules when updating the Computer asset, and only updates it if rules allows it, thus avoiding the override.

Screenshots (if appropriate):

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.

1 participant