Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix underlying exception reporting for CommandTimeout exceptions #1228

Conversation

@Kami
Copy link

@Kami Kami commented Dec 8, 2014

Currently if you run tasks in parallel mode and one of the hosts throws CommandTimeout, fabric.utils.error will return underlying exception as an empty string.

For example:

Fatal error: One or more hosts failed while executing task 'local'

Underlying exception:


Aborting.

The reason for that is that CommandTimeout class doesn't have message attribute so calling str() on it will return an empty string.

In [1]: from fabric.exceptions import CommandTimeout

In [2]: str(CommandTimeout())
Out[2]: ''

In this pull request I've added message attribute to the class so the underlying exception is now reported correctly.

In [1]: from fabric.exceptions import CommandTimeout

In [2]: str(CommandTimeout(1))
Out[2]: 'Command failed to finish in 1 seconds'

…ns a

message and not an empty string.

Also add timeout attribute so we have access to the original timeout argument.
@Kami Kami force-pushed the Kami:fix_command_timeout_underlying_exception_reporting_in_parallel_mode branch from 4d3b27c to 316e316 Dec 8, 2014
@bitprophet bitprophet added this to the 1.8.6/1.9.2 milestone Dec 12, 2014
@bitprophet
Copy link
Member

@bitprophet bitprophet commented Dec 12, 2014

Thanks, good catch. Looks reasonable offhand, adding to next bugfix release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.