fabric/fabric — pull request #1244 by dongweiming (2014-12-24 07:42:20+00:00)
Title: Fix check `destination` is a directory

it's a fabfile.py:

```python
from fabric.contrib.files import upload_template

context = {
'name': 'oscarmlage',
}

def update_temp():
upload_template(filename='xmas.conf',
destination='/home/vagrant/test/tmp/',
context=context,
template_dir='.',
use_jinja=True)
```

when i execute it:

```python
➜ test fab -H localhost update_temp --colorize-errors
[localhost] Executing task 'update_temp'
[localhost] put: -> /home/vagrant/test/tmp/

Fatal error: put() encountered an exception while uploading ''

Underlying exception:
Failure

Aborting.
Disconnecting from localhost... done.
put() encountered an exception while uploading ''

Underlying exception:
Failure

➜ test ipython
In [1]: import os

In [2]: os.path.isdir('/home/vagrant/test/tmp/')
Out[2]: True
```