

def TObjectCheck(obj, fields_types):
    'Helper to generate type checks for objects.\n\n  @param obj: The object to generate type checks\n  @param fields_types: The fields and their types as a dict\n  @return: A ht type check function\n\n  '
    assert (set(obj.GetAllSlots()) == set(fields_types.keys())), ('%s != %s' % (set(obj.GetAllSlots()), set(fields_types.keys())))
    return TStrictDict(True, True, fields_types)

dataset/ETHPy150Open ganeti/ganeti/lib/ht.py TObjectCheck/original