capistrano/capistrano — pull request #1066 by crhan (2014-05-29 04:40:38+00:00)
Title: Apply HostFilter for fetch_primary

When use capistrano with rails migration task, it will fetch the primary db server to run the migration. If I use HostFilter which does not include the primary db server. A "Directory Not Exists" error will occure.

So I think add the HostFilter to the `fetch_primary` method will help, and it does(for my situation).

## How to reproduce
```ruby
# deploy.rb
server "server1", roles: %w/app db web/
server "server2", roles: %w/app web/
```

### Deploy with hosts filter
```bash
cap production deploy --hosts=server2
```

### err logs
```
** Invoke deploy:migrate (first_time)
** Invoke deploy:set_rails_env
** Execute deploy:migrate
DEBUG [59ff49e4] Running /usr/bin/env if test ! -d /home/oob/apps/alioob/releases/20140528095735; then echo "Directory does not exist '/home/oob/apps/alioob/
releases/20140528095735'" 1>&2; false; fi on server1
DEBUG [59ff49e4] Command: if test ! -d /home/oob/apps/alioob/releases/20140528095735; then echo "Directory does not exist '/home/oob/apps/alioob/releases/201
40528095735'" 1>&2; false; fi
DEBUG [59ff49e4] Directory does not exist '/home/oob/apps/alioob/releases/20140528095735'
```

The key point is db migration task on server1 is triggered, which is not as expected with the hostfilter.