Gerrit hook scripts failing with IndexError exceptions

Bug #1276180 reported by Jeremy Stanley
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Core Infrastructure
Fix Released
High
Khai Do

Bug Description

Probably related to recent changes in Jeepyb and projects.yaml/projects.ini files...

Traceback (most recent call last):
  File "/usr/local/bin/update-blueprint", line 6, in <module>
    from jeepyb.cmd.update_blueprint import main
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/cmd/update_blueprint.py", line 31, in <module>
    from jeepyb import projects as p
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/projects.py", line 31, in <module>
    'PROJECTS_YAML')
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/utils.py", line 34, in __init__
    self._parse_file()
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/utils.py", line 38, in _parse_file
    configs_list = [config for config in yaml.load_all(open(file_path))][1]
IndexError: list index out of range

Traceback (most recent call last):
  File "/usr/local/bin/update-bug", line 6, in <module>
    from jeepyb.cmd.update_bug import main
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/cmd/update_bug.py", line 29, in <module>
    from jeepyb import projects as p
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/projects.py", line 31, in <module>
    'PROJECTS_YAML')
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/utils.py", line 34, in __init__
    self._parse_file()
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/utils.py", line 38, in _parse_file
    configs_list = [config for config in yaml.load_all(open(file_path))][1]
IndexError: list index out of range

Traceback (most recent call last):
  File "/usr/local/bin/notify-impact", line 6, in <module>
    from jeepyb.cmd.notify_impact import main
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/cmd/notify_impact.py", line 44, in <module>
    from jeepyb import projects
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/projects.py", line 31, in <module>
    'PROJECTS_YAML')
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/utils.py", line 34, in __init__
    self._parse_file()
  File "/usr/local/lib/python2.7/dist-packages/jeepyb/utils.py", line 38, in _parse_file
    configs_list = [config for config in yaml.load_all(open(file_path))][1]
IndexError: list index out of range

Revision history for this message
Jeremy Stanley (fungi) wrote :

We probably need to do something like manage_projects.py's...

    configs = [config for config in yaml.load_all(open(PROJECTS_YAML))]
    if os.path.exists(PROJECTS_INI):
        projects_yaml_list = configs[0]
        defaults = ConfigParser.ConfigParser()
        defaults.read(PROJECTS_INI)
        [...]
    else:
        projects_yaml_list = configs[1]
        defaults = configs[0][0]
        [...]

Ultimately I think we need to be going through jeepyb.utils.ProjectsYamlRegistry(), maybe indirectly via new functions in jeepyb.projects.

Revision history for this message
Khai Do (zaro0508) wrote :

fixed with change 56ff2a7c1d9011816da94ebb99893e1ef44a8f4e
I guess it didn't automatically link because it functionality was broken.

Changed in openstack-ci:
assignee: nobody → Khai Do (zaro0508)
Khai Do (zaro0508)
Changed in openstack-ci:
status: Triaged → Fix Committed
Khai Do (zaro0508)
Changed in openstack-ci:
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.