def addTag2Key ( aKey, aTag ):

    aTokens = aKey.split(':')

    if ( len(aTokens) >= 7 ):
        newKey = aTokens[0] + ':' + aTokens[1] + ':' + aTokens[2]
        if ( aTag[0] == "_" ):
            newKey += aTag
        else:
            newKey += "_" + aTag
        for ii in range(3,len(aTokens)):
            newKey += ":" + aTokens[ii]

    else:
        newKey = aKey
        if ( aTag[0] == "_" ):
            newKey += aTag
        else:
            newKey += "_" + aTag