Hello community, here is the log from the commit of package python-Fabric for openSUSE:Factory checked in at 2013-01-29 06:47:44 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-Fabric (Old) and /work/SRC/openSUSE:Factory/.python-Fabric.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Fabric", Maintainer is "" Changes: -------- --- /work/SRC/openSUSE:Factory/python-Fabric/python-Fabric.changes 2012-12-10 14:26:26.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.python-Fabric.new/python-Fabric.changes 2013-01-29 06:47:46.000000000 +0100 @@ -1,0 +2,19 @@ +Wed Jan 16 15:54:20 UTC 2013 - [email protected] + +- Update to 1.5.2: + - [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. + - [Bug] #604: Fixed wrong treatment of backslashes in put operation + when uploading directory tree on Windows. Thanks to Jason Coombs + for the catch and @diresys & Oliver Janik for the patch. for the patch. + - [Bug] #792: The newish shell_env context manager was incorrectly + omitted from the fabric.api import endpoint. This has been + remedied. Thanks to Vishal Rana for the catch. + - [Bug] #775: Shell escaping was incorrectly applied to the value + of $PATH updates in our shell environment handling, causing + (at the very least) local binary paths to become inoperable + in certain situations. This has been fixed. + - Added current host string to prompt abort error messages. + +------------------------------------------------------------------- Old: ---- Fabric-1.5.1.tar.bz2 New: ---- Fabric-1.5.2.tar.bz2 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-Fabric.spec ++++++ --- /var/tmp/diff_new_pack.AbU7vt/_old 2013-01-29 06:47:47.000000000 +0100 +++ /var/tmp/diff_new_pack.AbU7vt/_new 2013-01-29 06:47:47.000000000 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-Fabric # -# Copyright (c) 2012 SUSE LINUX Products GmbH, Nuernberg, Germany. +# Copyright (c) 2013 SUSE LINUX Products GmbH, Nuernberg, Germany. # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -17,7 +17,7 @@ Name: python-Fabric -Version: 1.5.1 +Version: 1.5.2 Release: 0 Summary: Fabric is a simple, Pythonic tool for remote execution and deployment License: BSD-2-Clause @@ -30,9 +30,9 @@ #TODO: Disabled due to errors / fudge requirement #BuildRequires: python-fudge #BuildRequires: python-nose -#BuildRequires: python-paramiko >= 1.9.0 # Documentation requirements: BuildRequires: python-Sphinx +BuildRequires: python-paramiko >= 1.9.0 Requires: python-distribute Requires: python-paramiko >= 1.9.0 BuildRoot: %{_tmppath}/%{name}-%{version}-build @@ -84,7 +84,7 @@ %build python setup.py build -sphinx-build -b html docs html && rm -r html/{.buildinfo,.doctrees} +python setup.py build_sphinx && rm -r build/sphinx/html/.buildinfo %install python setup.py install --prefix=%{_prefix} --root=%{buildroot} @@ -94,7 +94,7 @@ %files %defattr(-,root,root,-) -%doc AUTHORS LICENSE README.rst html +%doc AUTHORS LICENSE README.rst build/sphinx/html %{_bindir}/fab %{python_sitelib}/* ++++++ Fabric-1.5.1.tar.bz2 -> Fabric-1.5.2.tar.bz2 ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/Fabric.egg-info/PKG-INFO new/Fabric-1.5.2/Fabric.egg-info/PKG-INFO --- old/Fabric-1.5.1/Fabric.egg-info/PKG-INFO 2012-11-15 22:07:34.000000000 +0100 +++ new/Fabric-1.5.2/Fabric.egg-info/PKG-INFO 2013-01-16 03:27:46.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: Fabric -Version: 1.5.1 +Version: 1.5.2 Summary: Fabric is a simple, Pythonic tool for remote execution and deployment. Home-page: http://fabfile.org Author: Jeff Forcier diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/Fabric.egg-info/SOURCES.txt new/Fabric-1.5.2/Fabric.egg-info/SOURCES.txt --- old/Fabric-1.5.1/Fabric.egg-info/SOURCES.txt 2012-11-15 22:07:34.000000000 +0100 +++ new/Fabric-1.5.2/Fabric.egg-info/SOURCES.txt 2013-01-16 03:27:47.000000000 +0100 @@ -97,6 +97,7 @@ tests/test_version.py tests/utils.py tests/support/__init__.py +tests/support/classbased_task_fabfile.py tests/support/decorated_fabfile.py tests/support/decorated_fabfile_with_classbased_task.py tests/support/decorated_fabfile_with_modules.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/LICENSE new/Fabric-1.5.2/LICENSE --- old/Fabric-1.5.1/LICENSE 2012-02-26 04:31:35.000000000 +0100 +++ new/Fabric-1.5.2/LICENSE 2012-12-31 22:50:57.000000000 +0100 @@ -1,4 +1,4 @@ -Copyright (c) 2009, Christian Vest Hansen and Jeffrey E. Forcier +Copyright (c) 2013, Christian Vest Hansen and Jeffrey E. Forcier All rights reserved. Redistribution and use in source and binary forms, with or without diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/PKG-INFO new/Fabric-1.5.2/PKG-INFO --- old/Fabric-1.5.1/PKG-INFO 2012-11-15 22:07:35.000000000 +0100 +++ new/Fabric-1.5.2/PKG-INFO 2013-01-16 03:27:47.000000000 +0100 @@ -1,6 +1,6 @@ Metadata-Version: 1.0 Name: Fabric -Version: 1.5.1 +Version: 1.5.2 Summary: Fabric is a simple, Pythonic tool for remote execution and deployment. Home-page: http://fabfile.org Author: Jeff Forcier diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/docs/changelog.rst new/Fabric-1.5.2/docs/changelog.rst --- old/Fabric-1.5.1/docs/changelog.rst 2012-11-15 22:06:46.000000000 +0100 +++ new/Fabric-1.5.2/docs/changelog.rst 2013-01-16 03:27:31.000000000 +0100 @@ -25,6 +25,22 @@ Changelog ========= +* :release:`1.5.2 <2013-01-15>` +* :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. +* :bug:`604` Fixed wrong treatment of backslashes in put operation when uploading + directory tree on Windows. Thanks to Jason Coombs for the catch and + `@diresys` & Oliver Janik for the patch. + for the patch. +* :bug:`792` The newish `~fabric.context_managers.shell_env` context manager + was incorrectly omitted from the ``fabric.api`` import endpoint. This has + been remedied. Thanks to Vishal Rana for the catch. +* :bug:`775` Shell escaping was incorrectly applied to the value of ``$PATH`` + updates in our shell environment handling, causing (at the very least) + `~fabric.operations.local` binary paths to become inoperable in certain + situations. This has been fixed. +* Added current host string to prompt abort error messages. * :release:`1.5.1 <2012-11-15>` * :bug:`776` Fixed serious-but-non-obvious bug in direct-tcpip driven gatewaying (e.g. that triggered by ``-g`` or ``env.gateway``.) Should work @@ -37,10 +53,12 @@ ``ProxyCommand``-based gatewaying for SSH traffic. (This is distinct from tunneling non-SSH traffic over the SSH connection, which is :issue:`78` and not implemented yet.) + * Thanks in no particular order to Erwin Bolwidt, Oskari Saarenmaa, Steven Noonan, Vladimir Lazarenko, Lincoln de Sousa, Valentino Volonghi, Olle Lundberg and Github user `@acrish` for providing the original patches to both Fabric and Paramiko. + * :feature:`684` (also :issue:`569`) Update how `~fabric.decorators.task` wraps task functions to preserve additional metadata; this allows decorated functions to play nice with Sphinx autodoc. Thanks to Jaka Hudoklin for catch @@ -119,7 +137,7 @@ Fabric correctly printed such exceptions, and returned them from `~fabric.tasks.execute`, but did not actually cause the child or parent processes to halt with a nonzero status. This has been fixed. - `~fabric.tasks.execute` now also honors :ref:`env.warn_only <warn-only>` so + `~fabric.tasks.execute` now also honors :ref:`env.warn_only <warn_only>` so users may still opt to call it by hand and inspect the returned exceptions, instead of encountering a hard stop. Thanks to Matt Robenolt for the catch. * :feature:`241` Add the command executed as a ``.command`` attribute to the diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/docs/faq.rst new/Fabric-1.5.2/docs/faq.rst --- old/Fabric-1.5.1/docs/faq.rst 2012-11-05 22:40:15.000000000 +0100 +++ new/Fabric-1.5.2/docs/faq.rst 2013-01-09 05:39:36.000000000 +0100 @@ -8,6 +8,13 @@ <usage-docs>`, so please make sure you check those out if your question is not answered here. + +How do I dynamically set host lists? +==================================== + +See :ref:`dynamic-hosts`. + + .. _init-scripts-pty: Init scripts don't work! diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/docs/index.rst new/Fabric-1.5.2/docs/index.rst --- old/Fabric-1.5.1/docs/index.rst 2012-11-07 01:08:17.000000000 +0100 +++ new/Fabric-1.5.2/docs/index.rst 2013-01-03 02:51:54.000000000 +0100 @@ -24,6 +24,12 @@ from our Git repository, or fork us on Github. The :doc:`installation` page has details for how to access the source code. +.. warning:: + + If you install Fabric from Git, you will need to install its dependency + Paramiko from Git as well. See :doc:`the installation docs <installation>` + for details. + Development =========== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/docs/installation.rst new/Fabric-1.5.2/docs/installation.rst --- old/Fabric-1.5.1/docs/installation.rst 2012-10-01 14:19:35.000000000 +0200 +++ new/Fabric-1.5.2/docs/installation.rst 2013-01-03 02:51:54.000000000 +0100 @@ -15,14 +15,22 @@ $ sudo apt-get install fabric Advanced users wanting to install a development version may use ``pip`` to grab -the latest master branch:: +the latest master branch (as well as the dev version of the Paramiko +dependency):: + $ pip install paramiko==dev $ pip install fabric==dev Or, to install an editable version for debugging/hacking, execute ``pip install -e .`` (or ``python setup.py install``) inside a :ref:`downloaded <downloads>` or :ref:`cloned <source-code-checkouts>` copy of the source code. +.. warning:: + + Any development installs of Fabric (whether via ``==dev`` or ``install + -e``) require the development version of Paramiko to be installed + beforehand, or Fabric's installation may fail. + Dependencies ============ @@ -31,8 +39,8 @@ * the Python programming language; * the ``setuptools`` packaging/installation library; -* the Python ``ssh`` SSH2 library; -* and ``ssh``'s dependency, the PyCrypto cryptography library. +* the Python ``paramiko`` SSH2 library; +* and ``paramiko``'s dependency, the PyCrypto cryptography library. and, if using the :doc:`parallel execution mode </usage/parallel>`: @@ -234,11 +242,11 @@ C:\> pypm install fabric The following packages will be installed into "%APPDATA%\Python" (2.7): - ssh-1.7.8 pycrypto-2.4 fabric-1.3.0 + paramiko-1.7.8 pycrypto-2.4 fabric-1.3.0 Get: [pypm-free.activestate.com] fabric 1.3.0 - Get: [pypm-free.activestate.com] ssh 1.7.8 + Get: [pypm-free.activestate.com] paramiko 1.7.8 Get: [pypm-free.activestate.com] pycrypto 2.4 - Installing ssh-1.7.8 + Installing paramiko-1.7.8 Installing pycrypto-2.4 Installing fabric-1.3.0 Fixing script %APPDATA%\Python\Scripts\fab-script.py diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/docs/roadmap.rst new/Fabric-1.5.2/docs/roadmap.rst --- old/Fabric-1.5.1/docs/roadmap.rst 2012-11-15 22:06:32.000000000 +0100 +++ new/Fabric-1.5.2/docs/roadmap.rst 2013-01-09 05:39:54.000000000 +0100 @@ -10,31 +10,52 @@ This information is subject to change without warning, and should not be used as a basis for any life- or career-altering decisions! +Fabric 1.x +========== -Near-term feature releases and support work -=========================================== +Fabric 1.x, while not end-of-life'd, has reached a tipping point regarding +internal tech debt & ability to make significant improvements without harming +backwards compatibility. + +As such, future 1.x releases (**1.6** onwards) will emphasize small-to-medium +features (new features not requiring major overhauls of the internals) and +bugfixes. + +Invoke, Fabric 2.x and Patchwork +================================ + +While 1.x moves on as above, we are working on a reimagined 2.x version of the +tool, and plan to: + +* Finish and release `the Invoke tool/library + <https://github.com/pyinvoke/invoke>`_ (see also :issue:`565`), which is a + revamped and standalone version of Fabric's task running components. + + * Initially it will be basic, matching Fabric's current functionality, but + with a cleaner base to build on. + * Said cleaner base then gives us a jumping-off point for new task-oriented + features such as before/after hooks / call chains, task collections, + improved namespacing and so forth. -* Fabric **1.5**: SSH tunnelling, remote timeouts, improved SSH key debug info, - ``sudo`` improvements, and a bit more. See the `milestone issues page - <https://github.com/fabric/fabric/issues?milestone=22&state=open>`_ for what - remains to be done. - - -Invoke and Fabric 2.0 -===================== - -* Finish and release the Invoke library, which is a revamped and standalone - version of Fabric's task running components. See :issue:`565`. - * Initially it will be relatively basic, matching Fabric's current - functionality, but with a cleaner base to build on. - * That opens the door for dependencies and so forth. * Start putting together Fabric 2.0, a partly/mostly rewritten Fabric core: + * Leverage Invoke for task running, which will leave Fabric itself much more library oriented. - * Object-oriented hosts/host lists and all the fun stuff that provides - (e.g. no more hacky host string and unintuitive env var manipulation.) + * Implement object-oriented hosts/host lists and all the fun stuff that + provides (e.g. no more hacky host string and unintuitive env var + manipulation.) * No (or optional & non-default) shared state. * Any other core overhauls difficult to do in a backwards compatible fashion. * `Current issue list <https://github.com/fabric/fabric/issues?labels=2.x>`_ + +* Spin off ``fabric.contrib.*`` into a standalone "super-Fabric" (as in, "above Fabric") library, `Patchwork <https://github.com/fabric/patchwork>`_. + + * This lets core "execute commands on hosts" functionality iterate + separately from "commonly useful shortcuts using Fabric core". + * Lots of preliminary work & prior-art scanning has been done in + :issue:`461`. + * A public-but-alpha codebase for Patchwork exists as we think about the + API, and is currently based on Fabric 1.x. It will likely be Fabric 2.x + based by the time it is stable. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/docs/usage/execution.rst new/Fabric-1.5.2/docs/usage/execution.rst --- old/Fabric-1.5.1/docs/usage/execution.rst 2012-11-07 01:08:17.000000000 +0100 +++ new/Fabric-1.5.2/docs/usage/execution.rst 2013-01-09 05:46:10.000000000 +0100 @@ -103,6 +103,8 @@ part (username/hostname/port) in the environment dictionary, for both its use and for tasks to reference if the need arises. See :doc:`env` for details. +.. _execution-roles: + Roles ----- @@ -513,6 +515,86 @@ .. seealso:: `~fabric.tasks.execute`, `~fabric.decorators.runs_once` +.. _dynamic-hosts: + +Using ``execute`` with dynamically-set host lists +------------------------------------------------- + +A common intermediate-to-advanced use case for Fabric is to parameterize lookup +of one's target host list at runtime (when use of :ref:`execution-roles` does not +suffice). ``execute`` can make this extremely simple, like so:: + + from fabric.api import run, execute, task + + # For example, code talking to an HTTP API, or a database, or ... + from mylib import external_datastore + + # This is the actual algorithm involved. It does not care about host + # lists at all. + def do_work(): + run("something interesting on a host") + + # This is the user-facing task invoked on the command line. + @task + def deploy(lookup_param): + # This is the magic you don't get with @hosts or @roles. + # Even lazy-loading roles require you to declare available roles + # beforehand. Here, the sky is the limit. + host_list = external_datastore.query(lookup_param) + # Put this dynamically generated host list together with the work to be + # done. + execute(do_work, hosts=host_list) + +For example, if ``external_datastore`` was a simplistic "look up hosts by tag +in a database" service, and you wanted to run a task on all hosts tagged as +being related to your application stack, you might call the above like this:: + + $ fab deploy:app + +But wait! A data migration has gone awry on the DB servers. Let's fix up our +migration code in our source repo, and deploy just the DB boxes again:: + + $ fab deploy:db + +This use case looks similar to Fabric's roles, but has much more potential, and +is by no means limited to a single argument. Define the task however you wish, +query your external data store in whatever way you need -- it's just Python. + +The alternate approach +~~~~~~~~~~~~~~~~~~~~~~ + +Similar to the above, but using ``fab``'s ability to call multiple tasks in +succession instead of an explicit ``execute`` call, is to mutate +:ref:`env.hosts <hosts>` in a host-list lookup task and then call ``do_work`` +in the same session:: + + from fabric.api import run, task + + from mylib import external_datastore + + # Marked as a publicly visible task, but otherwise unchanged: still just + # "do the work, let somebody else worry about what hosts to run on". + @task + def do_work(): + run("something interesting on a host") + + @task + def set_hosts(lookup_param): + # Update env.hosts instead of calling execute() + env.hosts = external_datastore.query(lookup_param) + +Then invoke like so:: + + $ fab set_hosts:app do_work + +One benefit of this approach over the previous one is that you can replace +``do_work`` with any other "workhorse" task:: + + $ fab set_hosts:db snapshot + $ fab set_hosts:cassandra,cluster2 repair_ring + $ fab set_hosts:redis,environ=prod status + + .. _failures: Failure handling diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/docs/usage/ssh.rst new/Fabric-1.5.2/docs/usage/ssh.rst --- old/Fabric-1.5.1/docs/usage/ssh.rst 2012-06-23 18:41:22.000000000 +0200 +++ new/Fabric-1.5.2/docs/usage/ssh.rst 2012-12-28 23:25:35.000000000 +0100 @@ -18,8 +18,8 @@ details on how this works, please see the `OpenSSH documentation <http://openssh.org/manual.html>`_.) -The ``ssh`` library is capable of loading up your ``known_hosts`` file, and -will then compare any host it connects to, with that mapping. Settings are +The ``paramiko`` library is capable of loading up your ``known_hosts`` file, +and will then compare any host it connects to, with that mapping. Settings are available to determine what happens when an unknown host (a host whose username or IP is not found in ``known_hosts``) is seen: @@ -29,9 +29,9 @@ * **Add**: the new host key is added to the in-memory list of known hosts, the connection is made, and things continue normally. Note that this does **not** modify your on-disk ``known_hosts`` file! -* **Ask**: not yet implemented at the Fabric level, this is an ``ssh`` library - option which would result in the user being prompted about the unknown key - and whether to accept it. +* **Ask**: not yet implemented at the Fabric level, this is a ``paramiko`` + library option which would result in the user being prompted about the + unknown key and whether to accept it. Whether to reject or add hosts, as above, is controlled in Fabric via the :ref:`env.reject_unknown_hosts <reject-unknown-hosts>` option, which is False diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/fabric/api.py new/Fabric-1.5.2/fabric/api.py --- old/Fabric-1.5.1/fabric/api.py 2012-11-07 01:08:17.000000000 +0100 +++ new/Fabric-1.5.2/fabric/api.py 2012-12-28 23:25:35.000000000 +0100 @@ -7,7 +7,7 @@ well when you're using setup.py to install e.g. ssh! """ from fabric.context_managers import (cd, hide, settings, show, path, prefix, - lcd, quiet, warn_only) + lcd, quiet, warn_only, shell_env) from fabric.decorators import (hosts, roles, runs_once, with_settings, task, serial, parallel) from fabric.operations import (require, prompt, put, get, run, sudo, local, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/fabric/context_managers.py new/Fabric-1.5.2/fabric/context_managers.py --- old/Fabric-1.5.1/fabric/context_managers.py 2012-11-07 01:08:17.000000000 +0100 +++ new/Fabric-1.5.2/fabric/context_managers.py 2013-01-09 05:46:10.000000000 +0100 @@ -143,7 +143,7 @@ # If the current env value for this key still matches the # value we set it to beforehand, we are OK to revert it to the # pre-block value. - if value == state.env[key]: + if key in state.env and value == state.env[key]: if key in previous: state.env[key] = previous[key] else: @@ -163,9 +163,11 @@ * Most usefully, it allows temporary overriding/updating of ``env`` with any provided keyword arguments, e.g. ``with settings(user='foo'):``. Original values, if any, will be restored once the ``with`` block closes. + * The keyword argument ``clean_revert`` has special meaning for ``settings`` itself (see below) and will be stripped out before execution. + * In addition, it will use `contextlib.nested`_ to nest any given non-keyword arguments, which should be other context managers, e.g. ``with settings(hide('stderr'), show('stdout')):``. diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/fabric/decorators.py new/Fabric-1.5.2/fabric/decorators.py --- old/Fabric-1.5.1/fabric/decorators.py 2012-11-13 02:14:00.000000000 +0100 +++ new/Fabric-1.5.2/fabric/decorators.py 2012-12-28 23:25:35.000000000 +0100 @@ -170,7 +170,7 @@ def inner(*args, **kwargs): # Required for ssh/PyCrypto to be happy in multiprocessing # (as far as we can tell, this is needed even with the extra such - # calls in newer versions of the 'ssh' library.) + # calls in newer versions of paramiko.) Random.atfork() return func(*args, **kwargs) inner.parallel = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/fabric/main.py new/Fabric-1.5.2/fabric/main.py --- old/Fabric-1.5.1/fabric/main.py 2012-11-07 01:08:17.000000000 +0100 +++ new/Fabric-1.5.2/fabric/main.py 2013-01-16 03:27:31.000000000 +0100 @@ -210,8 +210,12 @@ name, obj = tup if is_task_object(obj): state.env.new_style_tasks = True - # Honor instance.name - new_style_tasks[obj.name] = obj + # Use instance.name if defined + if obj.name and obj.name != 'undefined': + new_style_tasks[obj.name] = obj + else: + obj.name = name + new_style_tasks[name] = obj # Handle aliasing if obj.aliases is not None: for alias in obj.aliases: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/fabric/network.py new/Fabric-1.5.2/fabric/network.py --- old/Fabric-1.5.1/fabric/network.py 2012-11-15 22:03:04.000000000 +0100 +++ new/Fabric-1.5.2/fabric/network.py 2013-01-11 05:17:48.000000000 +0100 @@ -382,7 +382,7 @@ # Otherwise, assume an auth exception, and prompt for new/better # password. - # The 'ssh' library doesn't handle prompting for locked private + # Paramiko doesn't handle prompting for locked private # keys (i.e. keys with a passphrase and not loaded into an agent) # so we have to detect this and tweak our prompt slightly. # (Otherwise, however, the logic flow is the same, because diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/fabric/operations.py new/Fabric-1.5.2/fabric/operations.py --- old/Fabric-1.5.1/fabric/operations.py 2012-11-15 20:20:49.000000000 +0100 +++ new/Fabric-1.5.2/fabric/operations.py 2013-01-16 03:27:31.000000000 +0100 @@ -688,8 +688,10 @@ env_vars.update(env.shell_env) if env_vars: - exports = ' '.join('%s="%s"' % (k, _shell_escape(v)) - for k, v in env_vars.iteritems()) + exports = ' '.join( + '%s="%s"' % (k, v if k == 'PATH' else _shell_escape(v)) + for k, v in env_vars.iteritems() + ) shell_env_str = 'export %s && ' % exports else: shell_env_str = '' @@ -967,7 +969,7 @@ standard error to the local standard out, while preserving it as its own distinct attribute on the return value (as per above.) Alternately, you could even provide your own stream objects or loggers, e.g. ``myout = - StringIO(); run("command, stdout=myout)``. + StringIO(); run("command", stdout=myout)``. Examples:: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/fabric/sftp.py new/Fabric-1.5.2/fabric/sftp.py --- old/Fabric-1.5.1/fabric/sftp.py 2012-11-07 01:08:17.000000000 +0100 +++ new/Fabric-1.5.2/fabric/sftp.py 2013-01-16 03:27:31.000000000 +0100 @@ -271,6 +271,8 @@ for context, dirs, files in os.walk(local_path): rcontext = context.replace(strip, '', 1) + # normalize pathname separators with POSIX separator + rcontext = rcontext.replace(os.sep, '/') rcontext = rcontext.lstrip('/') rcontext = posixpath.join(remote_path, rcontext) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/fabric/tasks.py new/Fabric-1.5.2/fabric/tasks.py --- old/Fabric-1.5.1/fabric/tasks.py 2012-11-13 02:14:00.000000000 +0100 +++ new/Fabric-1.5.2/fabric/tasks.py 2013-01-16 03:27:31.000000000 +0100 @@ -233,8 +233,10 @@ taskname:host=hostname``. Any other arguments or keyword arguments will be passed verbatim into - ``task`` when it is called, so ``execute(mytask, 'arg1', kwarg1='value')`` - will (once per host) invoke ``mytask('arg1', kwarg1='value')``. + ``task`` (the function itself -- not the ``@task`` decorator wrapping your + function!) when it is called, so ``execute(mytask, 'arg1', + kwarg1='value')`` will (once per host) invoke ``mytask('arg1', + kwarg1='value')``. This function returns a dictionary mapping host strings to the given task's return value for that host's execution run. For example, ``execute(foo, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/fabric/utils.py new/Fabric-1.5.2/fabric/utils.py --- old/Fabric-1.5.1/fabric/utils.py 2012-11-07 01:08:17.000000000 +0100 +++ new/Fabric-1.5.2/fabric/utils.py 2012-12-28 23:25:35.000000000 +0100 @@ -128,7 +128,9 @@ def handle_prompt_abort(prompt_for): import fabric.state - reason = "Needed to prompt for %s, but %%s" % prompt_for + reason = "Needed to prompt for %s (host: %s), but %%s" % ( + prompt_for, fabric.state.env.host_string + ) # Explicit "don't prompt me bro" if fabric.state.env.abort_on_prompts: abort(reason % "abort-on-prompts was set to True") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/fabric/version.py new/Fabric-1.5.2/fabric/version.py --- old/Fabric-1.5.1/fabric/version.py 2012-11-15 22:06:55.000000000 +0100 +++ new/Fabric-1.5.2/fabric/version.py 2013-01-16 03:27:31.000000000 +0100 @@ -9,7 +9,7 @@ from os.path import abspath, dirname -VERSION = (1, 5, 1, 'final', 0) +VERSION = (1, 5, 2, 'final', 0) def git_sha(): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/tests/support/classbased_task_fabfile.py new/Fabric-1.5.2/tests/support/classbased_task_fabfile.py --- old/Fabric-1.5.1/tests/support/classbased_task_fabfile.py 1970-01-01 01:00:00.000000000 +0100 +++ new/Fabric-1.5.2/tests/support/classbased_task_fabfile.py 2012-12-28 23:30:31.000000000 +0100 @@ -0,0 +1,7 @@ +from fabric import tasks + +class ClassBasedTask(tasks.Task): + def run(self, *args, **kwargs): + pass + +foo = ClassBasedTask() diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/tests/test_context_managers.py new/Fabric-1.5.2/tests/test_context_managers.py --- old/Fabric-1.5.1/tests/test_context_managers.py 2012-11-07 01:08:17.000000000 +0100 +++ new/Fabric-1.5.2/tests/test_context_managers.py 2012-12-28 23:25:35.000000000 +0100 @@ -1,13 +1,14 @@ from __future__ import with_statement +import os import sys from nose.tools import eq_, ok_ from fabric.state import env, output from fabric.context_managers import (cd, settings, lcd, hide, shell_env, quiet, - warn_only, prefix) -from fabric.operations import run + warn_only, prefix, path) +from fabric.operations import run, local from utils import mock_streams, FabricTest from server import server @@ -212,3 +213,28 @@ with warn_only(): run("ls /simple") assert sys.stdout.getvalue().strip() != "" + + +# path() (distinct from shell_env) + +class TestPathManager(FabricTest): + def setup(self): + super(TestPathManager, self).setup() + self.real = os.environ.get('PATH') + + def via_local(self): + with hide('everything'): + return local("echo $PATH", capture=True) + + def test_lack_of_path_has_default_local_path(self): + """ + No use of 'with path' == default local $PATH + """ + eq_(self.real, self.via_local()) + + def test_use_of_path_appends_by_default(self): + """ + 'with path' appends by default + """ + with path('foo'): + eq_(self.via_local(), self.real + ":foo") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.5.1/tests/test_main.py new/Fabric-1.5.2/tests/test_main.py --- old/Fabric-1.5.1/tests/test_main.py 2012-11-07 01:08:17.000000000 +0100 +++ new/Fabric-1.5.2/tests/test_main.py 2012-12-28 23:30:31.000000000 +0100 @@ -444,6 +444,19 @@ eq_(len(funcs), 1) ok_('foo' in funcs) + def test_class_based_tasks_are_found_with_variable_name(self): + """ + A new-style tasks with undefined name attribute should use the instance + variable name. + """ + module = fabfile('classbased_task_fabfile.py') + from fabric.state import env + with path_prefix(module): + docs, funcs = load_fabfile(module) + eq_(len(funcs), 1) + ok_('foo' in funcs) + eq_(funcs['foo'].name, 'foo') + def test_recursion_steps_into_nontask_modules(self): """ Recursive loading will continue through modules with no tasks -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
