<% if scope.lookupvar('spark::historyserver_hostname') == @fqdn -%>
<% properties = scope.lookupvar('spark::_properties').select { |name,value| (name =~ /^spark\.history\./) and value != '::undef' } -%>
<% s = '' -%>
<% properties.keys.each do |p| -%>
<% s = s + ' -D' + p + '=' + scope.lookupvar('spark::_properties')[p]-%>
<% end -%>
<% end -%>
export SPARK_HISTORY_SERVER_LOG_DIR=hdfs:///user/spark/applicationHistory
export SPARK_HISTORY_OPTS="$SPARK_HISTORY_OPTS -Dspark.history.fs.logDirectory=${SPARK_HISTORY_SERVER_LOG_DIR}<%= s -%>"
export SPARK_CONF_DIR=/etc/spark/conf

<% if scope.lookupvar('spark::historyserver_hostname') == @fqdn -%>
<% properties = scope.lookupvar('spark::_properties').select { |name,value| (name =~ /^spark\.history\./) and value != '::undef' } -%>
<% s = '' -%>
<% properties.keys.each do |p| -%>
<% s = s + ' -D' + p + '=' + scope.lookupvar('spark::_properties')[p].to_s -%>
<% end -%>
<% end -%>
export SPARK_HISTORY_SERVER_LOG_DIR=hdfs:///user/spark/applicationHistory
export SPARK_HISTORY_OPTS="$SPARK_HISTORY_OPTS -Dspark.history.fs.logDirectory=${SPARK_HISTORY_SERVER_LOG_DIR}<%= s -%>"
export SPARK_CONF_DIR=/etc/spark/conf

Fix syntax error when using with master: needs convert explicitly to string when using in string operation.
Fix syntax error when using with master: needs convert explicitly to string when using in string operation.
