

def TSetParamsMods(fn):
    'Generates a check for modification lists.\n\n  '
    old_mod_item_fn = TAnd(TIsLength(2), TItems([TOr(TElemOf(constants.DDMS_VALUES), TNonNegativeInt), fn]))
    mod_item_fn = TAnd(TIsLength(3), TItems([TElemOf(constants.DDMS_VALUES_WITH_MODIFY), Comment('Device index, can be negative, e.g. -1 for last disk')(TOr(TInt, TString)), fn]))
    return TOr(Comment('Recommended')(TListOf(mod_item_fn)), Comment('Deprecated')(TListOf(old_mod_item_fn)))

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