Hi, once again my pull request regarding 403. So I've fixed exception handling, HTTPError has response property with status_code.
In my case I'm receiving status code 403 while fetching job configuration at line 179 managed_jobs = (job for job in jenkins.jobs if tag in job.config). I've added additional method which returns "managed" jobs and catches exceptions if needed.
Last thing is performance optimizations:
Each time job.config is executed a new request is sent to the Jenkins server, now job name is checked before sending any request.
job.config was executed twice, at line 179 and 186, so two requests were sent. Now it is executed only once and returned in a tuple.
I've removed job.exists, which was sending request to the Jenkins. If we can get job configuration there is no need to check if the job still exists.
I've executed unit tests using tox so nothing should be broken.
Hi, once again my pull request regarding 403. So I've fixed exception handling,
HTTPError
hasresponse
property withstatus_code
. In my case I'm receiving status code 403 while fetching job configuration at line 179managed_jobs = (job for job in jenkins.jobs if tag in job.config)
. I've added additional method which returns "managed" jobs and catches exceptions if needed. Last thing is performance optimizations:job.config
is executed a new request is sent to the Jenkins server, now job name is checked before sending any request.job.config
was executed twice, at line 179 and 186, so two requests were sent. Now it is executed only once and returned in a tuple.job.exists
, which was sending request to the Jenkins. If we can get job configuration there is no need to check if the job still exists.I've executed unit tests using
tox
so nothing should be broken.