Project

General

Profile

Feature #6248

Add last line of failed command to CommandFailedError exception

Added by Zack Cerza over 10 years ago. Updated over 4 years ago.

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

0%

Source:
other
Tags:
Backport:
Reviewed:
Affected Versions:

Description

This would, for example, turn this:
CommandFailedError: Command failed on 10.214.131.12 with status 1: 'mkdir p - /home/ubuntu/cephtest/21969/mnt.0/client.0/tmp && cd -- /home/ubuntu/cephtest/21969/mnt.0/client.0/tmp && CEPH_CLI_TEST_DUP_COMMAND=1 CEPH_REF=dfcee0cbee21ed4ca500186c097a97c21b9ee799 TESTDIR="/home/ubuntu/cephtest/21969" CEPH_ID="0" PYTHONPATH="$PYTHONPATH:/home/ubuntu/cephtest/21969/binary/usr/local/lib/python2.7/dist-packages:/home/ubuntu/cephtest/21969/binary/usr/local/lib/python2.6/dist-packages" /home/ubuntu/cephtest/21969/adjust-ulimits ceph-coverage /home/ubuntu/cephtest/21969/archive/coverage /home/ubuntu/cephtest/21969/workunit.client.0/rest/test.py'

into this:
CommandFailedError: Command failed on 10.214.131.12 with status 1: 'mkdir p - /home/ubuntu/cephtest/21969/mnt.0/client.0/tmp && cd -- /home/ubuntu/cephtest/21969/mnt.0/client.0/tmp && CEPH_CLI_TEST_DUP_COMMAND=1 CEPH_REF=dfcee0cbee21ed4ca500186c097a97c21b9ee799 TESTDIR="/home/ubuntu/cephtest/21969" CEPH_ID="0" PYTHONPATH="$PYTHONPATH:/home/ubuntu/cephtest/21969/binary/usr/local/lib/python2.7/dist-packages:/home/ubuntu/cephtest/21969/binary/usr/local/lib/python2.6/dist-packages" /home/ubuntu/cephtest/21969/adjust-ulimits ceph-coverage /home/ubuntu/cephtest/21969/archive/coverage /home/ubuntu/cephtest/21969/workunit.client.0/rest/test.py'
Last line: requests.exceptions.ConnectionError: Max retries exceeded for url: /api/v0.1/auth/export

Next logical step would be grabbing entire remote tracebacks. Maybe even constructing a mock exception mirroring them and raising it... if we want to get into that sort of witchcraft.

History

#1 Updated by Zack Cerza over 10 years ago

  • Status changed from New to In Progress
  • Assignee set to Zack Cerza

I got really excited about this and implemented it:

https://github.com/ceph/teuthology/tree/wip-commandfail

But even though paramiko totally pretends that its BufferedFile objects are going to support seek(), they do not. Heartbreaking.

There's another way to do this, I'm sure, but... :(

#2 Updated by Zack Cerza almost 10 years ago

  • Assignee deleted (Zack Cerza)

#3 Updated by Ian Colle over 9 years ago

  • Status changed from In Progress to 4

#4 Updated by Patrick Donnelly over 4 years ago

  • Status changed from 4 to New

Also available in: Atom PDF