Skip to content

Commit

Permalink
suite/util: fix KeyError in get_sha1s
Browse files Browse the repository at this point in the history
The git.ceph.com:8080/history returns json with 'err' instead of 'error'.

  2021-04-21 08:29:51,334.334 DEBUG:teuthology.suite.util:got response: {'committish': 'e647a64c1e8147b04e84575a0fc53dee65cecab2', 'err': 'fatal: bad object e647a64c1e8147b04e84575a0fc53dee65cecab2\n', 'sha1s': []}
  Traceback (most recent call last):
    File "/home/runner/src/teuthology_master/virtualenv/bin/teuthology-suite", line 33, in <module>
      sys.exit(load_entry_point('teuthology', 'console_scripts', 'teuthology-suite')())
    File "/home/runner/src/teuthology_master/scripts/suite.py", line 189, in main
      return teuthology.suite.main(args)
    File "/home/runner/src/teuthology_master/teuthology/suite/__init__.py", line 143, in main
      run.prepare_and_schedule()
    File "/home/runner/src/teuthology_master/teuthology/suite/run.py", line 397, in prepare_and_schedule
      num_jobs = self.schedule_suite()
    File "/home/runner/src/teuthology_master/teuthology/suite/run.py", line 612, in schedule_suite
      util.find_git_parent('ceph', self.base_config.sha1)
    File "/home/runner/src/teuthology_master/teuthology/suite/util.py", line 491, in find_git_parent
      sha1s = get_sha1s(project, sha1, 2)
    File "/home/runner/src/teuthology_master/teuthology/suite/util.py", line 485, in get_sha1s
      int(count), sha1, project, resp.json()['error'])
  KeyError: 'error'

Signed-off-by: Kyr Shatskyy <[email protected]>
  • Loading branch information
Kyr Shatskyy committed Apr 21, 2021
1 parent 2713a3c commit dce3594
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion teuthology/suite/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,7 @@ def get_sha1s(project, committish, count):
if len(sha1s) != count:
log.debug('got response: %s', resp.json())
log.error('can''t find %d parents of %s in %s: %s',
int(count), sha1, project, resp.json()['error'])
int(count), sha1, project, resp.json()['err'])
return sha1s

# XXX don't do this every time?..
Expand Down

0 comments on commit dce3594

Please sign in to comment.