Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch '1.3'

Conflicts:
	AUTHORS
	docs/changelog.rst
	fabric/tasks.py
  • Loading branch information...
commit f263dca4509c65e9f9210ebf5dee6c4b6e91bb11 2 parents 3fd8013 + d14234a
Jeff Forcier bitprophet authored
1  AUTHORS
View
@@ -46,4 +46,5 @@ Matt Chisholm
Mark Merritt
Max Arnold
Szymon Reichmann
+David Wolever
Ben Davis
9 docs/changelog.rst
View
@@ -29,6 +29,15 @@ Changelog
library, and hooks for using it have been added (enabled by default; use
:option:`-A` to disable.) Thanks to Ben Davis for porting an existing
Paramiko patch to `ssh` and providing the necessary tweak to Fabric.
+* :bug:`450` Improve traceback display when handling ``ImportError``s for
+ dependencies. Thanks to David Wolever for the patches.
+* :bug:`446` Add QNX to list of secondary-case `~fabric.contrib.files.sed`
+ targets. Thanks to Rodrigo Madruga for the tip.
+* :bug:`443` `~fabric.contrib.files.exists` didn't expand tildes; now it does.
+ Thanks to Riccardo Magliocchetti for the patch.
+* :bug:`437` `~fabric.decorators.with_settings` now correctly preserves the
+ wrapped function's docstring and other attributes. Thanks to Eric Buckley for
+ the catch and Luke Plant for the patch.
* :bug:`400` Handle corner case of systems where ``pwd.getpwuid`` raises
``KeyError`` for the user's UID instead of returning a valid string. Thanks
to Dougal Matthews for the catch.
10 fabric/contrib/files.py
View
@@ -25,7 +25,7 @@ def exists(path, use_sudo=False, verbose=False):
behavior.
"""
func = use_sudo and sudo or run
- cmd = 'test -e "%s"' % path
+ cmd = 'test -e "$(echo %s)"' % path
# If verbose, run normally
if verbose:
with settings(warn_only=True):
@@ -101,8 +101,10 @@ def upload_template(filename, destination, context=None, use_jinja=False,
from jinja2 import Environment, FileSystemLoader
jenv = Environment(loader=FileSystemLoader(template_dir or '.'))
text = jenv.get_template(filename).render(**context or {})
- except ImportError, e:
- abort("tried to use Jinja2 but was unable to import: %s" % e)
+ except ImportError:
+ import traceback
+ tb = traceback.format_exc()
+ abort(tb + "\nUnable to import Jinja2 -- see above.")
else:
with open(filename) as inputfile:
text = inputfile.read()
@@ -164,7 +166,7 @@ def sed(filename, before, after, limit='', use_sudo=False, backup='.bak',
with hide('running', 'stdout'):
platform = run("uname")
- if platform in ('NetBSD', 'OpenBSD'):
+ if platform in ('NetBSD', 'OpenBSD', 'QNX'):
# Attempt to protect against failures/collisions
hasher = hashlib.sha1()
hasher.update(env.host_string)
1  fabric/decorators.py
View
@@ -205,6 +205,7 @@ def foo():
.. versionadded:: 1.1
"""
def outer(func):
+ @wraps(func)
def inner(*args, **kwargs):
with settings(**kw_settings):
return func(*args, **kwargs)
11 fabric/network.py
View
@@ -20,11 +20,12 @@
warnings.simplefilter('ignore', DeprecationWarning)
import ssh
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
+ import traceback
+ traceback.print_exc()
+ print >> sys.stderr, """
+There was a problem importing our SSH library (see traceback above).
+Please make sure all dependencies are installed and importable.
+""".rstrip()
sys.exit(1)
13 fabric/tasks.py
View
@@ -204,11 +204,14 @@ def execute(task, *args, **kwargs):
# if it can't.
try:
import multiprocessing
- except ImportError, e:
- msg = "At least one task needs to be run in parallel, but the\nmultiprocessing module cannot be imported:"
- msg += "\n\n\t%s\n\n" % e
- msg += "Please make sure the module is installed or that the above ImportError is\nfixed."
- abort(msg)
+ except ImportError:
+ import traceback
+ tb = traceback.format_exc()
+ abort(tb + """
+At least one task needs to be run in parallel, but the
+multiprocessing module cannot be imported (see above
+traceback.) Please make sure the module is installed
+or that the above ImportError is fixed.""")
# Wrap in another callable that nukes the child's cached
# connection object, if needed, to prevent shared-socket
Please sign in to comment.
Something went wrong with that request. Please try again.