Returns the entity associated with the entity dict representation

    Supported entities: cluster, vcenter

    Expected entity format:

    .. code-block:: python

        cluster:
            {'type': 'cluster',
             'datacenter': <datacenter_name>,
             'cluster': <cluster_name>}
        vcenter:
            {'type': 'vcenter'}

    service_instance
        Service instance (vim.ServiceInstance) of the vCenter.

    entity
        Entity dict in the format above

def _get_entity(service_instance, entity):
    '''
    Returns the entity associated with the entity dict representation

    Supported entities: cluster, vcenter

    Expected entity format:

    .. code-block:: python

        cluster:
            {'type': 'cluster',
             'datacenter': <datacenter_name>,
             'cluster': <cluster_name>}
        vcenter:
            {'type': 'vcenter'}

    service_instance
        Service instance (vim.ServiceInstance) of the vCenter.

    entity
        Entity dict in the format above
    '''

    log.trace('Retrieving entity: %s', entity)
    if entity['type'] == 'cluster':
        dc_ref = salt.utils.vmware.get_datacenter(service_instance,
                                                  entity['datacenter'])
        return salt.utils.vmware.get_cluster(dc_ref, entity['cluster'])
    elif entity['type'] == 'vcenter':
        return None
    raise ArgumentValueError('Unsupported entity type \'{0}\''
                             ''.format(entity['type']))