ronnix/fabtools — pull request #215 by deanmalmgren (2014-02-06 14:37:11+00:00)
Title: use env.host_string if no 'name' is specified with vagrant

The idea is to provide better support for multi-vagrant + fabric + fabtools usage patterns like `fab production packages` where the corresponding fabfile.py might look something like this:
```python
@task
def production():
env.hosts = ['vagrant_box_1', 'vagrant_box_2', 'vagrant_box_3']

@task
def packages():
with vagrant_settings():
fabtools.require.python.packages(["nltk", "scikit-learn"])
```
I think this makes it slightly easier to manage multi-machine vagrant setups.

If this is something that gets incorporated, I'd be happy to update #202 to also use the `_name_or_host_string` function in a similar way.

Please note that I wasn't exactly sure how this should affect the behavior of the `vagrant` task. Depending on what happens with #177, I could imagine incorporating a similar type of behavior using `_name_or_host_string` there, too, but its not exactly clear what the best usage pattern would be in that case.

I didn't add any tests for this as I wasn't exactly sure where to get started. I'd be happy to do whatever's necessary to get this merged in as its something that would make my fabfile's considerably simpler :)