def firstCfgWith(pmgr, field, val):
    """ Returns the first cfgID found where field is value """
    pmgr.updateTables()
    for cfg in pmgr.cfgs.keys():
        if pmgr.cfgs[cfg][field] == val:
            return cfg
    return None