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

Results should use the MOID as a key, not the name #35

Open
jeking3 opened this issue Oct 3, 2018 · 0 comments
Open

Results should use the MOID as a key, not the name #35

jeking3 opened this issue Oct 3, 2018 · 0 comments

Comments

@jeking3
Copy link
Contributor

jeking3 commented Oct 3, 2018

In some commands like host_get, vm_guest_info_get, and vm_env_items_get the results are indexed by name. Since names can be ambiguous (more so for VMs than hosts), it would be better to index results by MOID, otherwise two VMs with the same name in different datacenters might bash over each-other in the results. Further, if someone does a lookup of a host or a VM by MOID, they want the result indexed by MOID.

In general one should encourage folks to use get_moid to resolve something's name to a MOID, and then use the MOID for the rest of the time. This eliminates ambiguity in results, and is especially important when making modifications to things (to make sure the correct object is being manipulated). I see there is already logic in inventory.py to check for multiple objects and raise an exception.

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

No branches or pull requests

1 participant