def get_eqtype(dev):
    """ It extracts the eqtype from a device name like domain/family/eqtype-serial"""
    try:
        eq = str(dev).split('/')[-1].split('-', 1)[0].upper()
    except:
        eq = ''
    return eq
