Hello community,
here is the log from the commit of package python-Fabric for openSUSE:Factory
checked in at Mon Sep 5 16:38:49 CEST 2011.
--------
--- python-Fabric/python-Fabric.changes 2011-08-04 14:05:02.000000000 +0200
+++ python-Fabric/python-Fabric.changes 2011-09-02 09:46:20.000000000 +0200
@@ -1,0 +2,32 @@
+Fri Sep 2 07:44:44 UTC 2011 - saschpe@suse.de
+
+- Fixed link expansion error
+- Removed some unneeded stuff
+
+-------------------------------------------------------------------
+Fri Sep 2 01:19:44 UTC 2011 - alexandre@exatati.com.br
+
+- Update to 1.2.2:
+ - [Bug] #252: settings would silently fail to set env values for
+ keys which did not exist outside the context manager block. It
+ now works as expected. Thanks to Will Maier for the catch and
+ suggested solution.
+ - [Support] #393: Fixed a typo in an example code snippet in the
+ task docs. Thanks to Hugo Garza for the catch.
+ - [Bug] #396: --shortlist broke after the addition of --list-format
+ and no longer displayed the short list format correctly. This has
+ been fixed.
+ - [Bug] #373: Re-added missing functionality preventing host exclusion
+ from working correctly.
+ - [Bug] #303: Updated terminal size detection to correctly skip over
+ non-tty stdout, such as when running fab taskname | other_command.
+- Aditional changes from version 1.2.1:
+ - [Bug] #417: abort_on_prompts would incorrectly abort when set to
+ True, even if both password and host were defined. This has been
+ fixed. Thanks to Valerie Ishida for the report.
+ - [Support] #416: Updated documentation to reflect move from Redmine
+ to Github.
+ - [Bug] #389: Fixed/improved error handling when Paramiko import
+ fails. Thanks to Brian Luft for the catch.
+
+-------------------------------------------------------------------
calling whatdependson for head-i586
Old:
----
Fabric-1.2.0.tar.bz2
New:
----
Fabric-1.2.2.tar.bz2
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-Fabric.spec ++++++
--- /var/tmp/diff_new_pack.rkWuP5/_old 2011-09-05 16:38:21.000000000 +0200
+++ /var/tmp/diff_new_pack.rkWuP5/_new 2011-09-05 16:38:21.000000000 +0200
@@ -15,21 +15,16 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
-# norootforbuild
-%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
-%{!?python_sitearch: %global python_sitearch %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib(1)")}
-
-%define mod_name Fabric
-Name: python-%{mod_name}
-Version: 1.2.0
+Name: python-Fabric
+Version: 1.2.2
Release: 1
Url: http://fabfile.org
Summary: Fabric is a simple, Pythonic tool for remote execution and deployment
License: BSD
Group: Development/Languages/Python
-Source: %{mod_name}-%{version}.tar.bz2
+Source: Fabric-%{version}.tar.bz2
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: python-devel
BuildRequires: python-distribute
@@ -41,6 +36,7 @@
BuildArch: noarch
%endif
%endif
+%{!?python_sitelib: %global python_sitelib %(%{__python} -c "from distutils.sysconfig import get_python_lib; print get_python_lib()")}
%description
Fabric is a Python (2.5 or higher) library and command-line tool for
@@ -48,20 +44,20 @@
administration tasks.
It provides a basic suite of operations for executing local or remote shell
-commands (normally or via ``sudo``) and uploading/downloading files, as well as
+commands (normally or via sudo) and uploading/downloading files, as well as
auxiliary functionality such as prompting the running user for input, or
aborting execution.
Typical use involves creating a Python module containing one or more functions,
-then executing them via the ``fab`` command-line tool. Below is a small but
-complete "fabfile" containing a single task::
+then executing them via the fab command-line tool. Below is a small but
+complete "fabfile" containing a single task:
from fabric.api import run
def host_type():
run('uname -s')
-Once a task is defined, it may be run on one or more servers, like so::
+Once a task is defined, it may be run on one or more servers, like so:
$ fab -H localhost,linuxbox host_type
[localhost] run: uname -s
@@ -73,24 +69,20 @@
Disconnecting from localhost... done.
Disconnecting from linuxbox... done.
-In addition to use via the ``fab`` tool, Fabric's components may be imported
+In addition to use via the fab tool, Fabric's components may be imported
into other Python code, providing a Pythonic interface to the SSH protocol
suite at a higher level than that provided by e.g. Paramiko (which
Fabric itself leverages.)
%prep
-%setup -q -n %{mod_name}-%{version}
+%setup -q -n Fabric-%{version}
%build
-export CFLAGS="%{optflags}"
python setup.py build
%install
python setup.py install --prefix=%{_prefix} --root=%{buildroot}
-%clean
-rm -rf %{buildroot}
-
%files
%defattr(-,root,root,-)
%doc README
++++++ Fabric-1.2.0.tar.bz2 -> Fabric-1.2.2.tar.bz2 ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/Fabric.egg-info/PKG-INFO new/Fabric-1.2.2/Fabric.egg-info/PKG-INFO
--- old/Fabric-1.2.0/Fabric.egg-info/PKG-INFO 2011-07-13 02:39:42.000000000 +0200
+++ new/Fabric-1.2.2/Fabric.egg-info/PKG-INFO 2011-09-02 00:29:16.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: Fabric
-Version: 1.2.0
+Version: 1.2.2
Summary: Fabric is a simple, Pythonic tool for remote execution and deployment.
Home-page: http://fabfile.org
Author: Jeff Forcier
@@ -8,7 +8,7 @@
License: UNKNOWN
Description:
To find out what's new in this version of Fabric, please see `the changelog
- http://docs.fabfile.org/en/1.2.0/changelog.html`_.
+ http://docs.fabfile.org/en/1.2.2/changelog.html`_.
You can also install the `in-development version
https://github.com/fabric/fabric/tarball/master#egg=fabric-dev`_ using
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/PKG-INFO new/Fabric-1.2.2/PKG-INFO
--- old/Fabric-1.2.0/PKG-INFO 2011-07-13 02:39:42.000000000 +0200
+++ new/Fabric-1.2.2/PKG-INFO 2011-09-02 00:29:16.000000000 +0200
@@ -1,6 +1,6 @@
Metadata-Version: 1.0
Name: Fabric
-Version: 1.2.0
+Version: 1.2.2
Summary: Fabric is a simple, Pythonic tool for remote execution and deployment.
Home-page: http://fabfile.org
Author: Jeff Forcier
@@ -8,7 +8,7 @@
License: UNKNOWN
Description:
To find out what's new in this version of Fabric, please see `the changelog
- http://docs.fabfile.org/en/1.2.0/changelog.html`_.
+ http://docs.fabfile.org/en/1.2.2/changelog.html`_.
You can also install the `in-development version
https://github.com/fabric/fabric/tarball/master#egg=fabric-dev`_ using
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/docs/changelog.rst new/Fabric-1.2.2/docs/changelog.rst
--- old/Fabric-1.2.0/docs/changelog.rst 2011-07-13 02:18:31.000000000 +0200
+++ new/Fabric-1.2.2/docs/changelog.rst 2011-09-02 00:29:08.000000000 +0200
@@ -25,6 +25,31 @@
Changelog
=========
+* :release:`1.2.2 <2011-09-01>`
+* :release:`1.1.4 <2011-09-01>`
+* :release:`1.0.4 <2011-09-01>`
+* :bug:`252` `~fabric.context_managers.settings` would silently fail to set
+ ``env`` values for keys which did not exist outside the context manager
+ block. It now works as expected. Thanks to Will Maier for the catch and
+ suggested solution.
+* :support:`393` Fixed a typo in an example code snippet in the task docs.
+ Thanks to Hugo Garza for the catch.
+* :bug:`396` :option:`--shortlist` broke after the addition of
+ :option:`--list-format <-F>` and no longer displayed the short list format
+ correctly. This has been fixed.
+* :bug:`373` Re-added missing functionality preventing :ref:`host exclusion
+ <excluding-hosts>` from working correctly.
+* :bug:`303` Updated terminal size detection to correctly skip over non-tty
+ stdout, such as when running ``fab taskname | other_command``.
+* :release:`1.2.1 <2011-08-21>`
+* :release:`1.1.3 <2011-08-21>`
+* :release:`1.0.3 <2011-08-21>`
+* :bug:`417` :ref:`abort-on-prompts` would incorrectly abort when set to True,
+ even if both password and host were defined. This has been fixed. Thanks to
+ Valerie Ishida for the report.
+* :support:`416` Updated documentation to reflect move from Redmine to Github.
+* :bug:`389` Fixed/improved error handling when Paramiko import fails. Thanks
+ to Brian Luft for the catch.
* :release:`1.2.0 <2011-07-12>`
* :feature:`22` Enhanced `@task ` to add :ref:`aliasing
<task-aliases>`, :ref:`per-module default tasks <default-tasks>`, and
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/docs/development.rst new/Fabric-1.2.2/docs/development.rst
--- old/Fabric-1.2.0/docs/development.rst 2011-07-09 01:39:34.000000000 +0200
+++ new/Fabric-1.2.2/docs/development.rst 2011-09-01 23:34:51.000000000 +0200
@@ -4,10 +4,9 @@
The Fabric development team is headed by `Jeff Forcier
http://bitprophet.org`_, aka ``bitprophet``. However, dozens of other
-developers pitch in by submitting patches and ideas, via individual emails,
-`Redmine http://code.fabfile.org`_, the `mailing list
-http://lists.nongnu.org/mailman/listinfo/fab-user`_ and `GitHub
-http://github.com/fabric/fabric`_.
+developers pitch in by submitting patches and ideas via `GitHub
+https://github.com/fabric/fabric`_, :ref:`IRC <irc>` or the `mailing list
+http://lists.nongnu.org/mailman/listinfo/fab-user`_.
Get the code
============
@@ -23,21 +22,21 @@
* **Use Fabric and send us feedback!** This is both the easiest and arguably
the most important way to improve the project -- let us know how you
currently use Fabric and how you want to use it. (Please do try to search the
- `ticket tracker http://code.fabfile.org`_ first, though, when submitting
- feature ideas.)
+ `ticket tracker https://github.com/fabric/fabric/issues`_ first, though,
+ when submitting feature ideas.)
* **Report bugs.** Pretty much a special case of the previous item: if you
- think you've found a bug in Fabric, check on the `Redmine ticket tracker
- http://code.fabfile.org`_ to see if anyone's reported it yet, and if not --
- file a bug! If possible, try to make sure you can replicate it repeatedly,
- and let us know the circumstances (what version of Fabric you're using, what
- platform you're on, and what exactly you were doing when the bug cropped up.)
-* **Submit patches or new features.** See the :ref:`source-code-checkouts`
- documentation, grab a Git clone of the source, and either email a patch to
- the mailing list or make your own GitHub fork and post a link to your fork
- (or a specific commit on a fork) in the appropriate Redmine ticket.
- While we may not always reply promptly, we do try to make time eventually to
- inspect all contributions and either incorporate them or explain why we don't
- feel the change is a good fit.
+ think you've found a bug in Fabric, check on the `ticket tracker
+ https://github.com/fabric/fabric/issues`_ to see if anyone's reported it
+ yet, and if not -- file a bug! If possible, try to make sure you can
+ replicate it repeatedly, and let us know the circumstances (what version of
+ Fabric you're using, what platform you're on, and what exactly you were doing
+ when the bug cropped up.)
+* **Submit patches or new features.** Make a `Github https://github.com`_
+ account, `create a fork http://help.github.com/fork-a-repo/`_ of `the main
+ Fabric repository https://github.com/fabric/fabric`_, and `submit a pull
+ request http://help.github.com/send-pull-requests/`_.
+
+While we may not always reply promptly, we do try to make time eventually to inspect all contributions and either incorporate them or explain why we don't feel the change is a good fit.
Communication
-------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/docs/index.rst new/Fabric-1.2.2/docs/index.rst
--- old/Fabric-1.2.0/docs/index.rst 2011-07-08 22:58:14.000000000 +0200
+++ new/Fabric-1.2.2/docs/index.rst 2011-09-01 23:34:51.000000000 +0200
@@ -170,10 +170,10 @@
Bugs/ticket tracker
-------------------
-To file new bugs or search existing ones, you may visit Fabric's `Redmine
-http://redmine.org`_ instance, located at `code.fabfile.org
-http://code.fabfile.org`_. Due to issues with spam, you'll need to (quickly
-and painlessly) register an account in order to post new tickets.
+To file new bugs or search existing ones, you may visit Fabric's `Github Issues
+https://github.com/fabric/fabric/issues`_ page. This does require a (free, easy to set up) Github account.
+
+.. _irc:
IRC
---
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/docs/installation.rst new/Fabric-1.2.2/docs/installation.rst
--- old/Fabric-1.2.0/docs/installation.rst 2011-07-09 01:39:34.000000000 +0200
+++ new/Fabric-1.2.2/docs/installation.rst 2011-09-01 23:34:51.000000000 +0200
@@ -143,18 +143,15 @@
To obtain a tar.gz or zip archive of the Fabric source code, you may visit
either of the following locations:
-* The official downloads are located in Fabric's Redmine instance at
- http://code.fabfile.org/projects/fabric/files/. This is the spot you want
- to download from for operating system packages, as the only changing part of
- the URL will be the filename itself and the md5 hashes will be consistent.
+* The official downloads are located on `our Github account's Downloads page
+ https://github.com/fabric/fabric/downloads`_. This is the spot you want to
+ download from for operating system packages, as the only changing part of the
+ URL will be the filename itself and the md5 hashes will be consistent.
* Our `Git repository viewer http://git.fabfile.org`_ provides downloads of
all tagged releases. See the "Download" column, next to the "Tag" column in
the middle of the front page. Please note that due to how cgit generates tag
archives, the md5 sums will change over time, so use of this location for
package downloads is not recommended.
-* `Our GitHub mirror http://github.com/fabric/fabric`_ also has downloads
- of all tagged releases -- just click the 'Download' button near the top of
- the main page.
* `Fabric's PyPI page http://pypi.python.org/pypi/Fabric`_ offers manual
downloads in addition to being the entry point for ``pip`` and
``easy-install``.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/docs/usage/execution.rst new/Fabric-1.2.2/docs/usage/execution.rst
--- old/Fabric-1.2.0/docs/usage/execution.rst 2011-07-09 01:39:07.000000000 +0200
+++ new/Fabric-1.2.2/docs/usage/execution.rst 2011-09-02 00:28:55.000000000 +0200
@@ -384,11 +384,29 @@
per-task kwargs, in that it is stripped from the actual task invocation. This
example would have the same result as the global exclude above::
- $ fab -R myrole mytask:exclude_hosts="host2;host5"
+ $ fab mytask:roles=myrole,exclude_hosts="host2;host5"
Note that the host list is semicolon-separated, just as with the ``hosts``
per-task argument.
+Combining exclusions
+~~~~~~~~~~~~~~~~~~~~
+
+Host exclusion lists, like host lists themselves, are not merged together
+across the different "levels" they can be declared in. For example, a global
+``-x`` option will not affect a per-task host list set with a decorator or
+keyword argument, nor will per-task ``exclude_hosts`` keyword arguments affect
+a global ``-H`` list.
+
+There is one minor exception to this rule, namely that CLI-level keyword
+arguments (``mytask:exclude_hosts=x,y``) **will** be taken into account when
+examining host lists set via ``@hosts`` or ``@roles``. Thus a task function
+decorated with ``@hosts('host1', 'host2')`` executed as ``fab
+taskname:exclude_hosts=host2`` will only run on ``host1``.
+
+As with the host list merging, this functionality is currently limited (partly
+to keep the implementation simple) and may be expanded in future releases.
+
.. _failures:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/docs/usage/tasks.rst new/Fabric-1.2.2/docs/usage/tasks.rst
--- old/Fabric-1.2.0/docs/usage/tasks.rst 2011-07-13 01:53:47.000000000 +0200
+++ new/Fabric-1.2.2/docs/usage/tasks.rst 2011-09-02 00:29:08.000000000 +0200
@@ -66,7 +66,7 @@
The quickest way to make use of new-style task features is to wrap basic task functions with `@task `::
- from fabric.api import tasks, run
+ from fabric.api import task, run
@task
def mytask():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/fabric/context_managers.py new/Fabric-1.2.2/fabric/context_managers.py
--- old/Fabric-1.2.0/fabric/context_managers.py 2011-06-29 21:05:04.000000000 +0200
+++ new/Fabric-1.2.2/fabric/context_managers.py 2011-09-02 00:22:46.000000000 +0200
@@ -85,14 +85,19 @@
to be used directly.
"""
previous = {}
+ new = []
for key, value in kwargs.iteritems():
if key in env:
previous[key] = env[key]
+ else:
+ new.append(key)
env[key] = value
try:
yield
finally:
env.update(previous)
+ for key in new:
+ del env[key]
def settings(*args, **kwargs):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/fabric/main.py new/Fabric-1.2.2/fabric/main.py
--- old/Fabric-1.2.0/fabric/main.py 2011-07-13 01:53:47.000000000 +0200
+++ new/Fabric-1.2.2/fabric/main.py 2011-09-02 00:29:08.000000000 +0200
@@ -518,8 +518,9 @@
for pair in _escape_split(',', argstr):
k, _, v = pair.partition('=')
if _:
- # Catch, interpret host/hosts/role/roles/exclude_hosts kwargs
- if k in ['host', 'hosts', 'role', 'roles','exclude_hosts']:
+ # Catch, interpret host/hosts/role/roles/exclude_hosts
+ # kwargs
+ if k in ['host', 'hosts', 'role', 'roles', 'exclude_hosts']:
if k == 'host':
hosts = [v.strip()]
elif k == 'hosts':
@@ -567,11 +568,12 @@
role_hosts += value
# Return deduped combo of hosts and role_hosts, preserving order within
- # them (vs using set(), which may lose ordering).
+ # them (vs using set(), which may lose ordering) and skipping hosts to be
+ # excluded.
cleaned_hosts = _clean_hosts(list(hosts) + list(role_hosts))
all_hosts = []
for host in cleaned_hosts:
- if host not in all_hosts:
+ if host not in all_hosts and host not in exclude:
all_hosts.append(host)
return all_hosts
@@ -594,9 +596,8 @@
# Decorator-specific hosts/roles go next
func_hosts = getattr(command, 'hosts', [])
func_roles = getattr(command, 'roles', [])
- func_exclude_hosts = getattr(command, 'exclude_hosts', [])
if func_hosts or func_roles:
- return _merge(func_hosts, func_roles, func_exclude_hosts)
+ return _merge(func_hosts, func_roles, cli_exclude_hosts)
# Finally, the env is checked (which might contain globally set lists from
# the CLI or from module-level code). This will be the empty list if these
# have not been set -- which is fine, this method should return an empty
@@ -646,7 +647,8 @@
for option in env_options:
state.env[option.dest] = getattr(options, option.dest)
- # Handle --hosts, --roles, --exclude-hosts (comma separated string => list)
+ # Handle --hosts, --roles, --exclude-hosts (comma separated string =>
+ # list)
for key in ['hosts', 'roles', 'exclude_hosts']:
if key in state.env and isinstance(state.env[key], basestring):
state.env[key] = state.env[key].split(',')
@@ -702,6 +704,7 @@
# it overrides use of --list-format if somebody were to specify both
if options.shortlist:
options.list_format = 'short'
+ options.list_commands = True
# List available commands
if options.list_commands:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/fabric/network.py new/Fabric-1.2.2/fabric/network.py
--- old/Fabric-1.2.0/fabric/network.py 2011-07-09 01:39:07.000000000 +0200
+++ new/Fabric-1.2.2/fabric/network.py 2011-09-02 00:28:55.000000000 +0200
@@ -17,9 +17,13 @@
import warnings
warnings.simplefilter('ignore', DeprecationWarning)
import paramiko as ssh
-except ImportError:
- abort("paramiko is a required module. Please install it:\n\t"
- "$ sudo easy_install paramiko")
+except ImportError, e:
+ print >> sys.stderr, """There was a problem importing our SSH library. Specifically:
+
+ %s
+
+Please make sure all dependencies are installed and importable.""" % e
+ sys.exit(1)
host_pattern = r'((?P<user>.+)@)?(?P<host>[^:]+)(:(?P<port>\d+))?'
@@ -319,8 +323,8 @@
@wraps(func)
def host_prompting_wrapper(*args, **kwargs):
- handle_prompt_abort()
while not env.get('host_string', False):
+ handle_prompt_abort()
host_string = raw_input("No hosts found. Please specify (single)"
" host string for connection: ")
interpret_host_string(host_string)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/fabric/operations.py new/Fabric-1.2.2/fabric/operations.py
--- old/Fabric-1.2.0/fabric/operations.py 2011-07-09 01:39:07.000000000 +0200
+++ new/Fabric-1.2.2/fabric/operations.py 2011-09-02 00:28:55.000000000 +0200
@@ -40,12 +40,13 @@
local (stdout-based) terminal window size on non-Windows platforms.
"""
rows, cols = 24, 80
- if not win32 and sys.stdin.isatty():
+ if not win32 and sys.stdout.isatty():
# We want two short unsigned integers (rows, cols)
fmt = 'HH'
# Create an empty (zeroed) buffer for ioctl to map onto. Yay for C!
buffer = struct.pack(fmt, 0, 0)
- # Call TIOCGWINSZ to get window size of stdout, returns our filled buffer
+ # Call TIOCGWINSZ to get window size of stdout, returns our filled
+ # buffer
try:
result = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ,
buffer)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/fabric/version.py new/Fabric-1.2.2/fabric/version.py
--- old/Fabric-1.2.0/fabric/version.py 2011-07-13 02:17:18.000000000 +0200
+++ new/Fabric-1.2.2/fabric/version.py 2011-09-02 00:29:08.000000000 +0200
@@ -10,6 +10,9 @@
from os.path import abspath, dirname
+VERSION = (1, 2, 2, 'final', 0)
+
+
def git_sha():
loc = abspath(dirname(__file__))
p = Popen(
@@ -21,8 +24,6 @@
return p.communicate()[0]
-VERSION = (1, 2, 0, 'final', 0)
-
def get_version(form='short'):
"""
Return a version string for this package, based on `VERSION`.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/tests/test_context_managers.py new/Fabric-1.2.2/tests/test_context_managers.py
--- old/Fabric-1.2.0/tests/test_context_managers.py 2011-07-09 01:39:07.000000000 +0200
+++ new/Fabric-1.2.2/tests/test_context_managers.py 2011-09-02 00:28:55.000000000 +0200
@@ -1,6 +1,6 @@
from __future__ import with_statement
-from nose.tools import eq_
+from nose.tools import eq_, ok_
from fabric.state import env
from fabric.context_managers import cd, settings
@@ -44,14 +44,15 @@
# settings()
#
-def test_setting_new_env_dict_key_should_not_raise_keyerror():
+def test_setting_new_env_dict_key_should_work():
"""
- Using settings() with a previously nonexistent key should not error
+ Using settings() with a previously nonexistent key should work correctly
"""
- # Nose has no obvious way to assert a NON-RAISED exception :( so ye olde
- # "if it runs it passes" will have to do.
- with settings(thiskeyreallyshouldnotexist='value'):
- pass
+ key = 'thisshouldnevereverexistseriouslynow'
+ value = 'a winner is you'
+ with settings(**{key: value}):
+ ok_(key in env)
+ ok_(key not in env)
def test_settings():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/tests/test_main.py new/Fabric-1.2.2/tests/test_main.py
--- old/Fabric-1.2.0/tests/test_main.py 2011-07-13 01:53:47.000000000 +0200
+++ new/Fabric-1.2.2/tests/test_main.py 2011-09-02 00:29:08.000000000 +0200
@@ -179,8 +179,7 @@
assert 'foo' not in get_hosts(command, [], [])
-@patched_env({'hosts': [' foo ', 'bar '], 'roles': [],
- 'exclude_hosts':[]})
+@patched_env({'hosts': [' foo ', 'bar '], 'roles': [], 'exclude_hosts': []})
def test_hosts_stripped_env_hosts():
"""
Make sure hosts defined in env.hosts are cleaned of extra spaces
@@ -232,6 +231,24 @@
#
+# Host exclusion
+#
+
+def dummy(): pass
+
+def test_get_hosts_excludes_cli_exclude_hosts_from_cli_hosts():
+ assert 'foo' not in get_hosts(dummy, ['foo', 'bar'], [], ['foo'])
+
+def test_get_hosts_excludes_cli_exclude_hosts_from_decorator_hosts():
+ assert 'foo' not in get_hosts(hosts('foo', 'bar')(dummy), [], [], ['foo'])
+
+@patched_env({'hosts': ['foo', 'bar'], 'exclude_hosts': ['foo']})
+def test_get_hosts_excludes_global_exclude_hosts_from_global_hosts():
+ assert 'foo' not in get_hosts(dummy, [], [], [])
+
+
+
+#
# Basic role behavior
#
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/Fabric-1.2.0/tests/test_network.py new/Fabric-1.2.2/tests/test_network.py
--- old/Fabric-1.2.0/tests/test_network.py 2011-07-09 01:39:07.000000000 +0200
+++ new/Fabric-1.2.2/tests/test_network.py 2011-09-02 00:28:55.000000000 +0200
@@ -173,6 +173,9 @@
@raises(SystemExit)
@with_patched_object(output, 'aborts', False)
def test_aborts_on_prompt_with_abort_on_prompt(self):
+ """
+ abort_on_prompt=True should abort when prompt() is used
+ """
env.abort_on_prompts = True
prompt("This will abort")
@@ -181,6 +184,9 @@
@raises(SystemExit)
@with_patched_object(output, 'aborts', False)
def test_aborts_on_password_prompt_with_abort_on_prompt(self):
+ """
+ abort_on_prompt=True should abort when password prompts occur
+ """
env.password = None
env.abort_on_prompts = True
with password_response(PASSWORDS[env.user], times_called=1):
@@ -189,6 +195,18 @@
@mock_streams('stdout')
+ @server()
+ def test_does_not_abort_with_password_and_host_with_abort_on_prompt(self):
+ """
+ abort_on_prompt=True should not abort if no prompts are needed
+ """
+ env.abort_on_prompts = True
+ env.password = PASSWORDS[env.user]
+ # env.host_string is automatically filled in when using server()
+ run("ls /simple")
+
+
+ @mock_streams('stdout')
@server()
def test_trailing_newline_line_drop(self):
"""
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Remember to have fun...
--
To unsubscribe, e-mail: opensuse-commit+unsubscribe@opensuse.org
For additional commands, e-mail: opensuse-commit+help@opensuse.org