AMBARI-3732. Extract hosts selection dialog into a utility method. (srimanth)