cu2d-update-ci crash when deploying mbs projects with an empty project section

Bug #1185623 reported by Francis Ginther
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
cupstream2distro Configuration
Fix Released
Undecided
Unassigned

Bug Description

Deploying the head/oif.cfg stack caused the following crash:
Traceback (most recent call last):
  File "ci/cu2d-update-ci", line 40, in <module>
    sys.exit(command(BASEDIR))
  File "ci/../c2dconfigutils/cu2dUpdateCi.py", line 524, in __call__
    args.project):
  File "ci/../c2dconfigutils/cu2dUpdateCi.py", line 488, in update_jenkins
    self.process_stack(job_list, stack, target_project)
  File "ci/../c2dconfigutils/cu2dUpdateCi.py", line 402, in process_stack
    self.prepare_project(job_list, stack, project_name)
  File "ci/../c2dconfigutils/cu2dUpdateCi.py", line 371, in prepare_project
    ci_template, build_template, job_data)
  File "ci/../c2dconfigutils/cu2dUpdateCi.py", line 310, in generate_jobs
    builder_job=True)
  File "ci/../c2dconfigutils/cu2dUpdateCi.py", line 232, in process_project_config
    job_data['stack'], rebuild_project.strip())
  File "ci/../c2dconfigutils/cu2dUpdateCi.py", line 156, in get_rebuild_job
    get_ci_base_job_name(project_name, project))
  File "ci/../c2dconfigutils/c2dconfigutils.py", line 22, in get_ci_base_job_name
    if 'target_branch' not in config:
TypeError: argument of type 'NoneType' is not iterable

The relevant stack file contents is:
  projects:
    frame:
      rebuild: grail
    geis:
      rebuild: libgrip
    grail:
      rebuild: geis
    libgrip:

The code is attempting to generate the name of the rebuild job for libgrip. The issue is that the yaml block below libgrip is empty and therefore results in projects['libgrip'] == None. get_ci_base_job_name() assumes that the config argument is a dictionary.

The get_rebuild_job() code is only using the projects data from the original stack file before it is processed (so the defaults have not yet been merged in). To avoid having to fully process the stack, get_build_job() can just check for this condition.

Related branches

Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :

Fix committed into lp:cupstream2distro-config at revision 369, scheduled for release in cupstream2distro-config, milestone Unknown

Changed in cupstream2distro-config:
status: New → Fix Committed
Changed in cupstream2distro-config:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.