[Feat] - Get tags of VM from vSphere SDK Client#335
[Feat] - Get tags of VM from vSphere SDK Client#335oijkn wants to merge 2 commits intosaltstack:mainfrom
Conversation
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as resolved.
This comment was marked as outdated.
This comment was marked as outdated.
|
@oijkn thanks for the PR! I was under the impression that tags were get-able with our current approach but maybe that's a specific version of vSphere or something. A couple of things - first, tests are required for all code contributions. Meaningful unit tests are fine, but unit+integration are better. If you need help with writing tests - attend one of the Test Clinics on Twitch, and we'll be happy to help you get started 👍. We also want a changelog entry But more importantly, the vSphere SDK is a very finicky dependency. It has a known issue about pip-installing for a very long time. Almost a decade long. I've seen that dependency cause a number of issues in upstream Salt, which gives me very very strong reservations about making it a dependency of our project. I'm OK with making it an optional dependency that's basically completely isolated. Something to this effect: Then it could do something like this: The create_vsphere_client would also need to be similarly protected. Honestly, I wouldn't put the If we can't get the tags any other way 🤷 we can go ahead and provide the ability here. But if someone can't install the SDK, or it gives some issues, then we shouldn't be broken -- we should just carry on as normal, though we can log at an info or warning level or something, if that's useful. |
With the previous code, the tags did not appear when I did the
salt-call vmware_vm.info <minion>command.By adding the vSphere SDK Client, the tags are ok in the return of the command.
Important: it is mandatory to install the new dependencies.