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

`@parallel' decorator causes TypeError if it's not placed as the last decorator of a task #1068

alb-i986 opened this Issue Feb 12, 2014 · 2 comments


None yet
4 participants

alb-i986 commented Feb 12, 2014

While writing a task, I noticed that @parallel works only if it is placed as the last decorator of a task (just above def). I don't think it is the expected behavior, is it?

Affected versions (these are the ones I tried): 1.6.0, 1.7.0, 1.8.1

I'm on:

  • ubuntu precise 32bit
  • Python 2.7.3
  • Paramiko 1.12.1

Here is the task:

from fabric.api import *
from fabric.contrib import *

def vms_update():
  with settings(
    hide('warnings', 'running', 'stdout', 'stderr')
    sudo("aptitude update")
  sudo("aptitude upgrade")

Here is the output:

$ fab vms_update
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/fabric/", line 743, in main
    *args, **kwargs
  File "/usr/local/lib/python2.7/dist-packages/fabric/", line 405, in execute
    results['<local-only>'] =*args, **new_kwargs)
  File "/usr/local/lib/python2.7/dist-packages/fabric/", line 171, in run
    return self.wrapped(*args, **kwargs)
TypeError: real_decorator() takes exactly 1 argument (0 given)

But everything's fine if @parallel is placed on the line before the task def:

def vms_update():

This comment has been minimized.

nchammas commented Mar 13, 2015


I just ran into this as well and confirmed that moving @parallel to be the last decorator makes things work again.


This comment has been minimized.

adaszko commented Apr 29, 2015

Just encountered this myself too, so +1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment