Issue Type: Bug Bug
Affects Versions: current
Assignee: Unassigned
Components: core
Created: 19/Dec/13 10:03 AM
Description:

Jenkins version 1.544.

I use the python jenkinsapi-0.2.16-py2.7 to copy a job and then get it's config, modify it and update it.

After that, the job is not buildable. If I disable it and reenable it again, it's buildable again.

I think this is a regression when JENKINS-2494 was fixed. It worked well some Jenkins versions back. Se also JENKINS-20744 which deals with a similar problem for the CLI.

This is my python function that configures the job (XXX = censored info):

def create_job(template_job, new_job, enable=True, verbose=False, debug=False, **context):
"""
Create a job from a template job.
"""

j = jenkins.Jenkins('http://XXX', username='XXX', password='XXX')

if j.has_job(template_job):
templ_job = j.get_job(template_job)
else:
print "Couldn't find template job " + template_job
sys.exit(1)

if not j.has_job(new_job):
if verbose:
print "Creating new job " + new_job
job = j.copy_job(template_job, new_job)
else:
job = j.get_job(new_job)
if verbose:
print "Modifying already existing job " + new_job

config = templ_job.get_config()
new_config = create_config(config, enable, **context)
job.update_config(new_config)

Project: Jenkins
Priority: Major Major
Reporter: Magnus Jacobsson
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira

--
You received this message because you are subscribed to the Google Groups "Jenkins Issues" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to