Looks like a piece that was never meant as an enclosure. Some type of rubber bar end that the they just put the components in and filled it with potting compound. Maybe Mcmaster-Carr will have something.
Actually, doing a quick search through McMaster-Carr, the ‘pliable vinyl caps’ look very much like what you want.