Project

General

Profile

Actions

Bug #9519

closed

teuthology-lock: if downburst list-json fails, error is confusing

Added by Dan Mick over 9 years ago. Updated over 9 years ago.

Status:
Resolved
Priority:
Normal
Assignee:
-
Category:
-
% Done:

0%

Source:
Development
Tags:
Backport:
Regression:
Severity:
3 - minor
Reviewed:
Affected Versions:
ceph-qa-suite:
Crash signature (v1):
Crash signature (v2):

Description

I had updated teuthology but not updated-and-rebootstrapped downburst; as a result, downburst simply didn't have the list-json command that teuthology-lock wants to see for vps locking. The error, however, was not caught correctly, and reported with a Python traceback that looked a lot like "the os version isn't available", so I spent a while debugging it until I found that it was easier; the missing list-json meant there was no output, which was not trapped.

This code fixes it, in a kind of a cheap way; probably some other exception is more appropriate:

--- a/teuthology/lock.py
+++ b/teuthology/lock.py
@@ -54,6 +54,9 @@ def get_distro_from_downburst():
         p = subprocess.Popen([executable_cmd, 'list-json'],
                              stdout=subprocess.PIPE, stderr=subprocess.PIPE,)
         output, err = p.communicate()
+        if p.returncode != 0:
+            log.info('downburst list-json failed')
+            raise OSError
         downburst_data = json.loads(output)
         return downburst_data
Actions #1

Updated by Dan Mick over 9 years ago

  • Source changed from other to Development
Actions #2

Updated by Anonymous over 9 years ago

  • Status changed from New to 12
  • Assignee set to Anonymous
Actions #3

Updated by Anonymous over 9 years ago

The code has been changed as suggested. I thought about testing err on the p.communicate() return, but that returns text. Scanning for Errors in that text seemed less clean than checking the communicate() return code. I also considered returning default_table, but scrapped that idea because I think that we still want to print the "Using default values..." log.info messaage
when this happens.

This change is ready for review as pull request #334.

Actions #4

Updated by Anonymous over 9 years ago

  • Status changed from 12 to Fix Under Review
  • Assignee changed from Anonymous to Dan Mick
Actions #5

Updated by Dan Mick over 9 years ago

  • Status changed from Fix Under Review to 4
Actions #6

Updated by Dan Mick over 9 years ago

  • Assignee changed from Dan Mick to Anonymous
Actions #7

Updated by Anonymous over 9 years ago

  • Status changed from 4 to Resolved

Commit a6ce70d05250f8927d050b513a2f58ccd76de878

Actions

Also available in: Atom PDF