<div dir="auto">Hi <div dir="auto"> I think the import command needs to be refined , try import all modules separately.</div></div><div class="gmail_extra"><br><div class="gmail_quote">On Feb 23, 2018 3:05 PM, "Karthikeyan S" <<a href="mailto:karthik120@gmail.com">karthik120@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>Hi Python group, <br><br></div>I wrote a code to execute list of jenkins job by reading a text file. So far, it's able to read the text file and get the jobs one by one. Only problem is with the requests command<br><br></div>Please see the sample code below<br><br> #!/usr/bin/env python<br>import requests,time,json<br>fobj = open("file")<br>for x in fobj:<br>       x = x.replace("\n", "")<br>       url="<a href="https://username">https://username</a>:<wbr>password@localhost/jenkins/<wbr>job/job-name/<wbr>buildWithParameters"<br>       params = {'BRANCH':x}<br>       headers = {"Content-Type": "application/xml"}<br>       r = request.post(url , params=params, verify=False)<br>       print(r.status_code)<br>       print(r.text)<br>       #time.sleep(45)<br>fobj.close() <br><br><br></div>Error<br>------<br>Traceback (most recent call last):<br> File "./delete_build_job_exeuction.<wbr>py", line 12, in <module><br>   r = sess.post(url , params=params, verify=False)<br> File "/Library/Frameworks/Python.<wbr>framework/Versions/2.7/lib/<wbr>python2.7/site-packages/<wbr>requests/sessions.py", line 555, in post<br>   return self.request('POST', url, data=data, json=json, **kwargs)<br> File "/Library/Frameworks/Python.<wbr>framework/Versions/2.7/lib/<wbr>python2.7/site-packages/<wbr>requests/sessions.py", line 508, in request<br>   resp = self.send(prep, **send_kwargs)<br> File "/Library/Frameworks/Python.<wbr>framework/Versions/2.7/lib/<wbr>python2.7/site-packages/<wbr>requests/sessions.py", line 618, in send<br>   r = adapter.send(request, **kwargs)<br> File "/Library/Frameworks/Python.<wbr>framework/Versions/2.7/lib/<wbr>python2.7/site-packages/<wbr>requests/adapters.py", line 506, in send<br>   raise SSLError(e, request=request)<br>requests.exceptions.SSLError: HTTPSConnectionPool(host='<wbr>localhost', port=443): Max retries exceeded with url: /jenkins/job/job--name/<wbr>buildWithParameter/<wbr>buildWithParameters?BRANCH=<wbr>super (Caused by SSLError(SSLEOFError(8, u'EOF occurred in violation of protocol (_ssl.c:590)'),)) <br><br><br></div>Could you please help ?<br><div><br></div></div>
<br>______________________________<wbr>_________________<br>
Chennaipy mailing list<br>
<a href="mailto:Chennaipy@python.org">Chennaipy@python.org</a><br>
<a href="https://mail.python.org/mailman/listinfo/chennaipy" rel="noreferrer" target="_blank">https://mail.python.org/<wbr>mailman/listinfo/chennaipy</a><br>
<br></blockquote></div></div>