Fix encoding error in builder.py
When calling `jenkins-jobs update --delete`, the builder will create an XML dom tree from the xml string. It fails to correctly encode the string, which results in a UnicodeEncodeError if the string contains any non-ascii characters. Story: 2006374 Task: 36163 Change-Id: I2caf91dcaf2c1b6c03e92a485a3aa51b038b40b1 Signed-off-by: Achim Leitner <git@fjl.de>
This commit is contained in:
parent
079900b4e7
commit
cbc6819978
@ -181,7 +181,7 @@ class JenkinsManager(object):
|
||||
def is_managed(self, job_name):
|
||||
xml = self.jenkins.get_job_config(job_name)
|
||||
try:
|
||||
out = XML.fromstring(xml)
|
||||
out = XML.fromstring(xml.encode('utf-8'))
|
||||
description = out.find(".//description").text
|
||||
return description.endswith(MAGIC_MANAGE_STRING)
|
||||
except (TypeError, AttributeError):
|
||||
|
Loading…
Reference in New Issue
Block a user