Unfortunately this was needed for yarn-client mode in batch mode.  The spark-shell stuff is taken care of by the changes I made to repl, but the yarn-client batch mode needs. this.