gvalkov / jenkins-autojobs

Automatically create Jenkins jobs from template jobs and branches in a SCM repository
http://jenkins-autojobs.rtfd.org
Other
49 stars 39 forks source link

self.xml.xpath('/project/description')[0] "list index out of range" #54

Closed PaulKlumpp closed 8 years ago

PaulKlumpp commented 8 years ago

Using Python 2.7, Autojobs 0.17.2, the following happens. Before, we used Autojobs 0.15.1:

loading config from "/var/lib/jenkins/soa-build-01/jobs/Jenkins Autojobs/workspace/autojobs1.yaml"

processing branch: bw-ac/AdapterAISuite/branches/1.6.x
. job name: bw-ac_AdapterAISuite_branches_1.6.x
. job exists: True
Traceback (most recent call last):
  File "/bin/jenkins-makejobs-svn", line 11, in <module>
    sys.exit(_main())
  File "/usr/lib/python2.7/site-packages/jenkins_autojobs/svn.py", line 135, in _main
    main.main(argv[1:], config=config, create_job=create_job, list_branches=list_branches)
  File "/usr/lib/python2.7/site-packages/jenkins_autojobs/main.py", line 160, in main
    job_name = create_job(branch, tmpl, config, branch_config)
  File "/usr/lib/python2.7/site-packages/jenkins_autojobs/svn.py", line 127, in create_job
    tag_method=config['tag-method']
  File "/usr/lib/python2.7/site-packages/jenkins_autojobs/job.py", line 92, in create
    self.tag_config(tag, tag_method)
  File "/usr/lib/python2.7/site-packages/jenkins_autojobs/job.py", line 72, in tag_config
    desc_el = self.xml.xpath('/project/description')[0]
IndexError: list index out of range
gvalkov commented 8 years ago

Hi and thank you for reporting this. I just pushed jenkins-autojobs 0.17.3 to PyPi with a fix: 0619831e4809ba7807b6fea575febdcefacc8b95.