简体   繁体   中英

"build_job() got an unexpected keyword argument" Error when jenkins jobs triggered through jenkins API

def runjob(joblist): server = Jenkins('http://localhost:8080', username='',password='' ) for x in joblist: server.build_job(name=x,token="NRT")这个曾经运行并触发作业,但现在开始抛出此错误,我已经卸载了 py2.7 这可能是原因吗?

Solved it, there is a jenkins package and jenkinsapi package in python.

Both of them has .build_job() method but jenkinsapi doesnt allow to pass it in the above format. It was running as should when I removed the jenkinsapi import and added a jenkins. after the = in the code.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM