Browse files

Merge pull request #709 from rsaikali/master

List of tasks to be executed

Conflicts:
	docs/changelog.rst
  • Loading branch information...
2 parents 0857b1a + 35f690d commit 3e7bdd324f27baedd0abc2e35c82e194d2211704 @bitprophet bitprophet committed Dec 28, 2012
Showing with 16 additions and 0 deletions.
  1. +2 −0 docs/changelog.rst
  2. +10 −0 docs/usage/env.rst
  3. +3 −0 fabric/main.py
  4. +1 −0 fabric/state.py
View
2 docs/changelog.rst
@@ -25,6 +25,8 @@ would have also been included in the 1.2 line.
Changelog
=========
+* :feature:`706` Added ``env.tasks``, returning list of tasks to be executed
+ by current ``fab`` command.
* :bug:`766` Use the variable name of a new-style ``fabric.tasks.Task``
subclass object when the object name attribute is undefined. Thanks to
`@todddeluca` for the patch.
View
10 docs/usage/env.rst
@@ -642,6 +642,16 @@ none is given. Useful in combination with `~fabric.context_managers.settings`.
.. seealso:: `~fabric.operations.sudo`
+``tasks``
+-------------
+
+**Default:** ``[]``
+
+Set by ``fab`` to the full tasks list to be executed for the currently executing command. For
+informational purposes only.
+
+.. seealso:: :doc:`execution`
+
.. _timeout:
``timeout``
View
3 fabric/main.py
@@ -621,6 +621,9 @@ def main(fabfile_locations=None):
if key in state.env and isinstance(state.env[key], basestring):
state.env[key] = state.env[key].split(',')
+ # Feed the env.tasks : tasks that are asked to be executed.
+ state.env['tasks'] = arguments
+
# Handle output control level show/hide
update_output_levels(show=options.show, hide=options.hide)
View
1 fabric/state.py
@@ -318,6 +318,7 @@ def _rc_path():
'sudo_prefix': "sudo -S -p '%(sudo_prompt)s' ",
'sudo_prompt': 'sudo password:',
'sudo_user': None,
+ 'tasks': [],
'use_exceptions_for': {'network': False},
'use_shell': True,
'use_ssh_config': False,

0 comments on commit 3e7bdd3

Please sign in to comment.