def get_object_properties_dict(vim, moref, properties_to_collect):
    obj_contents = get_object_properties(vim, moref, properties_to_collect)
    if obj_contents is None:
        return {}
    property_dict = {}
    if hasattr(obj_contents[0], 'propSet'):
        dynamic_properties = obj_contents[0].propSet
        if dynamic_properties:
            for prop in dynamic_properties:
                property_dict[prop.name] = prop.val
    # The object may have information useful for logging
    if hasattr(obj_contents[0], 'missingSet'):
        for m in obj_contents[0].missingSet:
            LOG.warning(_LW("Unable to retrieve value for %(path)s "
                            "Reason: %(reason)s"),
                        {'path': m.path,
                         'reason': m.fault.localizedMessage})
    return property_dict
Get properties of the given managed object as a dict.
dataset/ETHPy150Open openstack/oslo.vmware/oslo_vmware/vim_util.py/get_object_properties_dict