Accessing jenkins server from python

76 views
Skip to first unread message

Deependra

unread,
Jan 27, 2012, 7:38:46 AM1/27/12
to Jenkins Users
Hi all,

I have setup jenkins server 1.449 and it is up and running just fine.
I also installed the jenkins EC2 plugin and configured the same.

My objective is to use the jenkins python API to create a new node and
add it to the jenkins cluster. For that I wrote the following code
(correct me if I am wrong):

from jenkinsapi.jenkins import Jenkins
jenkinsurl="http://127.0.0.1:8080/"
jenkinsuser="jeevanullas"
jenkinspass="password"
conn=Jenkins(jenkinsurl,jenkinsuser,jenkinspass)
node=conn.create_node(name="test-
vm-1",num_executors=1,node_description="ec2-node",remote_fs="/
tmp",labels="jenkins-ec2-1",exclusive=False)

But it gives me a error:

No handlers could be found for logger "jenkinsapi.jenkins"
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/site-packages/jenkinsapi-0.1-py2.7.egg/
jenkinsapi/jenkins.py", line 227, in create_node
fn_urlopen(url).read()
File "/usr/lib64/python2.7/urllib2.py", line 400, in open
response = meth(req, response)
File "/usr/lib64/python2.7/urllib2.py", line 513, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib64/python2.7/urllib2.py", line 438, in error
return self._call_chain(*args)
File "/usr/lib64/python2.7/urllib2.py", line 372, in _call_chain
result = func(*args)
File "/usr/lib64/python2.7/urllib2.py", line 521, in
http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 500: Internal Server Error

Any pointers or help in this regard is much appreciated.

Cheers,
Deependra

krikar

unread,
Oct 14, 2012, 4:03:14 AM10/14/12
to jenkins...@googlegroups.com
Did you ever fix the problem?

Reply all
Reply to author
Forward
0 new messages