Skip to content

Commit

Permalink
Merge pull request #2 from warp3r/master
Browse files Browse the repository at this point in the history
Added support for jobs with unicode characters
  • Loading branch information
phwitservices authored Jun 30, 2016
2 parents 6ee2008 + d9a24c9 commit ad40c7f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions RundeckLogfileCleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def get_jobs_for_project(project_name):
url = URL + 'jobs'
payload = { 'project': project_name }
r = requests.get(url, params=payload, headers=HEADERS, verify=False,timeout=PROPERTIES['TIMEOUT'])
root = ET.fromstring(r.text)
root = ET.fromstring(r.text.encode('utf-8'))
for job in root:
job_ids.append( (job.attrib['id'],job.find('name').text) )
except:
Expand All @@ -48,7 +48,7 @@ def get_executions_for_job(job_id,page):
try:
url = URL + 'job/'+job_id+'/executions'
r = requests.get(url, params={'max':PROPERTIES['PAGE_SIZE'],'offset':page*PROPERTIES['PAGE_SIZE']}, headers=HEADERS, verify=False,timeout=PROPERTIES['TIMEOUT'])
root = ET.fromstring(r.text)
root = ET.fromstring(r.text.encode('utf-8'))
except:
print "Problem with execution listing {0}".format(r)
pass
Expand Down Expand Up @@ -132,7 +132,7 @@ def check_deletion(execid_dates):
for project in get_projects():
print project
for (jobid,jobname) in get_jobs_for_project(project):
print " {0}".format(jobname)
print " {0}".format(jobname.encode('utf-8'))
page = 0
deleteable = ()
more = True
Expand Down

0 comments on commit ad40c7f

Please sign in to comment.