Use the command to create a job for Jenkins and resolve the jenkinsapi.custom_exceptions. Jenkinsapiexception Error

Source: Internet
Author: User

If you use the Python 2.7.12,jenkins version for Jenkins ver. 2.22, you can perform a job copy of Jenkins by using the following code of the modifications I mentioned above

Http://www.cnblogs.com/chongyou/p/8414334.html

But if you have a Python version of 2.7.5,jenkins version for Jenkins ver. 2.73.1, or an issue jenkinsapi.custom_exceptions using API errors. Jenkinsapiexception, use the following code to

From __future__ import print_functionfrom jenkinsapi.jenkins import Jenkinsfrom jenkinsapi.utils.crumb_requester Import crumbrequesterimport sysreload (SYS) sys.setdefaultencoding (' utf8 ') jenkins_url = ' domain name/jenkins/' jenkins_user = ' Admin ' Jenkins_password = ' 123 ' def copy_jenkinsjob (job_name):    jenkins = Jenkins (Jenkins_url, Username=jenkins_ User, Password=jenkins_user, Requester=crumbrequester (Username=jenkins_user, Password=jenkins_password, baseurl= Jenkins_url))    jenkins.copy_job (' demo ', job_name) if __name__== ' __main__ ':    print (Copy_jenkinsjob (). version )    Print (Copy_jenkinsjob (' jun1 '))

  

Use the command to create a job for Jenkins and resolve the jenkinsapi.custom_exceptions. Jenkinsapiexception Error

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.