'Make a usage dict _update methods expect.
Accepts a dict or an Instance or Flavor object, and a set of updates.
Converts the object to a dict and applies the updates.
:param object_or_dict: instance or flavor as an object or just a dict
:param updates: key-value pairs to update the passed object.
Currently only considers \'numa_topology\', all other
keys are ignored.
:returns: a dict with all the information from object_or_dict updated
with updates'

def _get_usage_dict(self, object_or_dict, **updates):

    usage = {}
    if isinstance(object_or_dict, objects.Instance):
        usage = {'memory_mb': object_or_dict.flavor.memory_mb, 'vcpus': object_or_dict.flavor.vcpus, 'root_gb': object_or_dict.flavor.root_gb, 'ephemeral_gb': object_or_dict.flavor.ephemeral_gb, 'numa_topology': object_or_dict.numa_topology}
    elif isinstance(object_or_dict, objects.Flavor):
        usage = obj_base.obj_to_primitive(object_or_dict)
    else:
        usage.update(object_or_dict)
    for key in ('numa_topology',):
        if (key in updates):
            usage[key] = updates[key]
    return usage
