File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed
core/src/main/scala/org/apache/spark/deploy Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -55,13 +55,14 @@ private[spark] class SparkSubmitArguments(args: Array[String]) {
5555 if (primaryResource == null ) SparkSubmit .printErrorAndExit(" Must specify a primary resource" )
5656 if (mainClass == null ) SparkSubmit .printErrorAndExit(" Must specify a main class with --class" )
5757 if (propertiesFile == null ) {
58- val sparkHome = sys.env(" SPARK_HOME" ) // defined via `spark-class`
59- val sep = File .separator
60- val defaultPath = s " ${sparkHome}${sep}conf ${sep}spark-defaults.properties "
61- val file = new File (defaultPath)
62- if (file.exists()) {
63- propertiesFile = file.getAbsolutePath
64- }
58+ sys.env.get(" SPARK_HOME" ).foreach { sparkHome =>
59+ val sep = File .separator
60+ val defaultPath = s " ${sparkHome}${sep}conf ${sep}spark-defaults.properties "
61+ val file = new File (defaultPath)
62+ if (file.exists()) {
63+ propertiesFile = file.getAbsolutePath
64+ }
65+ }
6566 }
6667
6768 override def toString = {
You can’t perform that action at this time.
0 commit comments