Closed bartoszj closed 9 years ago
Hello @bartoszj,
Your change was breaking the test suite. Does the fix in a63ed0a6b585ca4a2751f03064b49a4df7822e32 work for you?
Hi, unfortunately a63ed0a
doesn't fix my issue. My problem occurs while reading job configuration. This the exception that I got:
Traceback (most recent call last):
File "/Users/bjanda/Downloads/OtherProjects/jenkins-autojobs/pp/bin/jenkins-makejobs-git", line 9, in <module>
load_entry_point('jenkins-autojobs==0.16.0', 'console_scripts', 'jenkins-makejobs-git')()
File "/Users/bjanda/Downloads/OtherProjects/jenkins-autojobs/jenkins_autojobs/git.py", line 130, in main
_main(argv[1:], config=config, create_job=create_job, list_branches=list_branches)
File "/Users/bjanda/Downloads/OtherProjects/jenkins-autojobs/jenkins_autojobs/main.py", line 170, in main
cleanup(config, job_names, jenkins)
File "/Users/bjanda/Downloads/OtherProjects/jenkins-autojobs/jenkins_autojobs/main.py", line 182, in cleanup
for job in managed_jobs:
File "/Users/bjanda/Downloads/OtherProjects/jenkins-autojobs/jenkins_autojobs/main.py", line 179, in <genexpr>
managed_jobs = (job for job in jenkins.jobs if tag in job.config)
File "/Users/bjanda/Downloads/OtherProjects/jenkins-autojobs/pp/lib/python2.7/site-packages/jenkins.py", line 56, in config
res = self.server.get(url)
File "/Users/bjanda/Downloads/OtherProjects/jenkins-autojobs/pp/lib/python2.7/site-packages/jenkins.py", line 473, in get
throw and res.raise_for_status()
File "/Users/bjanda/Downloads/OtherProjects/jenkins-autojobs/pp/lib/python2.7/site-packages/requests/models.py", line 851, in raise_for_status
raise HTTPError(http_error_msg, response=self)
requests.exceptions.HTTPError: 403 Client Error: Forbidden
In case when jenkins user doesn't have access to some jobs configuration during cleanup
requests
throws exception:I've added try ... except in the
cleanup
function. When an error occurs a job will be skipped.