Merge "Fix Spark installation fails when parsing spark-env.sh"

This commit is contained in:
Jenkins 2015-11-03 14:22:44 +00:00 committed by Gerrit Code Review
commit e506909be0
1 changed files with 11 additions and 1 deletions

View File

@ -143,7 +143,7 @@ class EnvironmentConfig(BaseConfigurationFile):
def parse(self, content):
for line in content.splitlines():
line = six.text_type(line.strip())
line = self._escape(line)
match = self._regex.match(line)
if match:
name, value = match.groups()
@ -153,6 +153,16 @@ class EnvironmentConfig(BaseConfigurationFile):
else:
self._lines.append(line)
@staticmethod
def _escape(string):
try:
string = string.decode("utf-8")
except AttributeError:
pass
string = six.text_type(string).strip()
string = string.replace("\"", "")
return string
def render(self):
result = []
for line in self._lines: