extract old vagrant version compatibility code into util method

This reduces some code duplication we had from compatibility code for vagrant < 1.5.