python-jenkins api run_script() error

Asked by Dona

Hi all,

I am working in a project and i use python-jenkins api. But i have a pb. Indeed, when i try to run a script inside my python script like the example it does not works. After i would like to create a file with the run_script() reference. I know that it s execute a groovy script in the jenkins server.

import jenkins
from jenkins import Jenkins
jenkins_url = 'http://localhost:8080'
server = Jenkins(jenkins_url, username=None, password=None)
info = server.run_script("println(Jenkins.instance.pluginManager.plugins)")
print(info)

I have this error when i run the script :

File "/usr/local/lib/python2.7/dist-packages/jenkins/init.py", line 928, in run_script "script=".encode('utf-8') + script.encode('utf-8'))) File "/usr/local/lib/python2.7/dist-packages/jenkins/init.py", line 361, in jenkins_open raise NotFoundException('Requested item could not be found') jenkins.NotFoundException: Requested item could not be found

Please please help me
Dona

http://stackoverflow.com/questions/33809481/python-jenkins-api-run-script-error

Question information

Language:
English Edit question
Status:
Solved
For:
Python Jenkins Edit question
Assignee:
No assignee Edit question
Solved by:
Dona
Solved:
Last query:
Last reply:
Revision history for this message
Dona (g-poubelle) said :
#1

I resolved it