Re: [Chennaipy] Require help in code

2018-02-24 Thread Bharathwaaj S
Thank you Vijay. That was insightful. Kind regards, Bharath On Fri, Feb 23, 2018 at 9:15 PM, Karthikeyan S wrote: > curl -X POST https://@localhost// > buildWithParameters?BRANCH= > > > On Fri, Feb 23, 2018 at 5:26 PM, Karthikeyan S > wrote: > >> Thank you.. will share curl command later toda

Re: [Chennaipy] Require help in code

2018-02-23 Thread Karthikeyan S
curl -X POST https:// @localhost//buildWithParameters?BRANCH= On Fri, Feb 23, 2018 at 5:26 PM, Karthikeyan S wrote: > Thank you.. will share curl command later today > > On Feb 23, 2018 5:09 PM, "Shrayas rajagopal" wrote: > >> [image: Boxbe] This message is eli

Re: [Chennaipy] Require help in code

2018-02-23 Thread Karthikeyan S
Thanks Vijay.. let me try this in MAC On Feb 23, 2018 5:08 PM, "Vijay Kumar" wrote: > [image: Boxbe] This message is eligible > for Automatic Cleanup! (vijayku...@bravegnu.org) Add cleanup rule >

Re: [Chennaipy] Require help in code

2018-02-23 Thread Karthikeyan S
Thank you.. will share curl command later today On Feb 23, 2018 5:09 PM, "Shrayas rajagopal" wrote: > [image: Boxbe] This message is eligible > for Automatic Cleanup! (shray...@gmail.com) Add cleanup rule >

Re: [Chennaipy] Require help in code

2018-02-23 Thread Vijay Kumar
On Fri, February 23, 2018 4:37 pm, Shrayas rajagopal wrote: > It might be a better approach to actually investigate _why_ the > problem occured in the first place. That way you get closure on the source > of the problem and what you did to fix it. I don't see why it shouldn't > work on Mac but work

Re: [Chennaipy] Require help in code

2018-02-23 Thread Shrayas rajagopal
Hi, On Fri, Feb 23, 2018 at 3:37 PM, Karthikeyan S wrote: > Yes, via CURL command it works perfectly. Can you share the cURL command for it? On Fri, Feb 23, 2018 at 4:27 PM, Karthikeyan S wrote: > Thanks Everyone.. The issue seem to be specific with Mac.. I have moved the > script to CentOS to

Re: [Chennaipy] Require help in code

2018-02-23 Thread Karthikeyan S
Thanks Everyone.. The issue seem to be specific with Mac.. I have moved the script to CentOS to make it work. On Fri, Feb 23, 2018 at 4:18 PM, Bharathwaaj S wrote: > This looks like hosts entry missing. But since it seems to work in curl, > I'm clueless. :/ > > On Fri, Feb 23, 2018 at 3:59 PM, K

Re: [Chennaipy] Require help in code

2018-02-23 Thread Bharathwaaj S
This looks like hosts entry missing. But since it seems to work in curl, I'm clueless. :/ On Fri, Feb 23, 2018 at 3:59 PM, Karthikeyan S wrote: > Changing it to sessions resulted in the error below > > (Caused by NewConnectionError(' object at 0x106278610>: Failed to establish a new connection:

Re: [Chennaipy] Require help in code

2018-02-23 Thread Karthikeyan S
Changing it to sessions resulted in the error below (Caused by NewConnectionError(': Failed to establish a new connection: [Errno 8] nodename nor servname provided, or not known',)) On Fri, Feb 23, 2018 at 3:55 PM, Karthikeyan S wrote: > I saw this sort of code with session in the stackoverflow

Re: [Chennaipy] Require help in code

2018-02-23 Thread Karthikeyan S
I saw this sort of code with session in the stackoverflow and I tried it before posting it in the forum.. The error remains the same. On Fri, Feb 23, 2018 at 3:52 PM, Bharathwaaj S wrote: > Try using session. > > import requests,time,json > > session = requests.Session() > adapter = requests.ada

Re: [Chennaipy] Require help in code

2018-02-23 Thread Bharathwaaj S
Try using session. import requests,time,json session = requests.Session() adapter = requests.adapters.HTTPAdapter(max_retries = 5) session.mount('http://', adapter) fobj = open("file") for x in fobj: x = x.replace("\n", "") url="https://username:password@localhost/jenkins/job/job-n

Re: [Chennaipy] Require help in code

2018-02-23 Thread Karthikeyan S
Yes, via CURL command it works perfectly. On Fri, Feb 23, 2018 at 3:13 PM, Shrayas rajagopal wrote: > Hi Karthikeyan, > > On Fri, Feb 23, 2018 at 3:02 PM, Karthikeyan S > wrote: > > [...] > > > Could you please help ? > > Are you able to execute the same thing outside of python? i.e. with > ano

Re: [Chennaipy] Require help in code

2018-02-23 Thread Shrayas rajagopal
Hi Karthikeyan, On Fri, Feb 23, 2018 at 3:02 PM, Karthikeyan S wrote: [...] > Could you please help ? Are you able to execute the same thing outside of python? i.e. with another RESTful client like postman? Regards, Shrayas ___ Chennaipy mailing lis

Re: [Chennaipy] Require help in code

2018-02-23 Thread Karthikeyan S
Nope same error On Fri, Feb 23, 2018 at 3:08 PM, Saravanan Muthu wrote: > Hi > I think the import command needs to be refined , try import all modules > separately. > > On Feb 23, 2018 3:05 PM, "Karthikeyan S" wrote: > >> Hi Python group, >> >> I wrote a code to execute list of jenkins job by

Re: [Chennaipy] Require help in code

2018-02-23 Thread Saravanan Muthu
Hi I think the import command needs to be refined , try import all modules separately. On Feb 23, 2018 3:05 PM, "Karthikeyan S" wrote: > Hi Python group, > > 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 o

[Chennaipy] Require help in code

2018-02-23 Thread Karthikeyan S
Hi Python group, 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 Please see the sample code below #!/usr/bin/env python import requests,time,json fobj = open("fil