def stub_instance_obj(ctxt, *args, **kwargs):
    db_inst = stub_instance(*args, **kwargs)
    expected = ['metadata', 'system_metadata', 'flavor', 'info_cache', 'security_groups']
    inst = objects.Instance._from_db_object(ctxt, objects.Instance(), db_inst, expected_attrs=expected)
    inst.fault = None
    return inst
def stub_instance_obj(ctxt, *args, **kwargs):
    db_inst = stub_instance(*args, **kwargs)
    expected = ['metadata', 'system_metadata', 'flavor', 'info_cache', 'security_groups']
    inst = objects.Instance._from_db_object(ctxt, objects.Instance(), db_inst, expected_attrs=expected)
    inst.fault = None
    return inst