fabric/fabric — Issue #581: In parallel mode env.host contains port specification
Author: max-arnold
Created: 2012-03-09 21:43:06+00:00
State: open

Is there any reason why env.host contains full host_string when fabric runs in parallel mode? Consider an example:

```python
from fabric.api import *

def task():
print env.host, env.port
```

Single process:

```bash
$ fab -H example.com:12345 task

[example.com:1226] Executing task 'task'
example.com 12345
```

Parallel mode:

```bash
$ fab -P -H example.com:12345 task

[example.com:1226] Executing task 'task'
example.com:12345 12345
```

In fabric tasks I often match env.host and env.port against env.roledefs to distinguish between staging/production servers and this pattern breaks in parallel mode (at least with Fabric 1.4). Documentation says it should contain hostname only:

```
host
Default: None

Set to the hostname part of env.host_string by fab.
```