Skip to content

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

Description

@jeking3

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.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions