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

Failed to launch tasks : TypeError("Tasks must have an initial Context argument!") #34

Open
ajmalahd opened this issue Feb 20, 2017 · 0 comments

Comments

@ajmalahd
Copy link

When tried to list all the task supported by trireme using inv -l, the command failed with the following stacktrace:

Traceback (most recent call last):
  File "/usr/local/bin/inv", line 11, in <module>
    sys.exit(program.run())
  File "/usr/local/lib/python2.7/dist-packages/invoke/program.py", line 286, in run
    self._parse(argv)
  File "/usr/local/lib/python2.7/dist-packages/invoke/program.py", line 352, in _parse
    self.load_collection()
  File "/usr/local/lib/python2.7/dist-packages/invoke/program.py", line 500, in load_collection
    coll = loader.load(coll_name) if coll_name else loader.load()
  File "/usr/local/lib/python2.7/dist-packages/invoke/loader.py", line 53, in load
    module = imp.load_module(name, fd, path, desc)
  File "/home/ajmal/test/migrate/tasks.py", line 2, in <module>
    from trireme import trireme
  File "/usr/local/lib/python2.7/dist-packages/trireme/trireme.py", line 4, in <module>
    from trireme.migrators import cassandra, solr
  File "/usr/local/lib/python2.7/dist-packages/trireme/migrators/cassandra.py", line 53, in <module>
    @task
  File "/usr/local/lib/python2.7/dist-packages/invoke/tasks.py", line 275, in task
    return Task(args[0], **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/invoke/tasks.py", line 61, in __init__
    self.positional = self.fill_implicit_positionals(positional)
  File "/usr/local/lib/python2.7/dist-packages/invoke/tasks.py", line 152, in fill_implicit_positionals
    args, spec_dict = self.argspec(self.body)
  File "/usr/local/lib/python2.7/dist-packages/invoke/tasks.py", line 147, in argspec
    raise TypeError("Tasks must have an initial Context argument!")

I think the error is related to a recent change in the invoke library, and can be worked around by adding a context parameter to every task function.

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

No branches or pull requests

1 participant