saltstack/salt — pull request #12621 by JustinCarmony (2014-05-08 07:03:43+00:00)
Title: Check for pki_dir's master/minions before chdir into it

When using salt-ssh, it is possible that you do not have an ``pki/master/minions`` directory. This is common if you specify your own configuration directory. When this happens you get an exception like this:

```
salt-ssh '*' pkg.install htop
[ERROR ] Failed matching available minions with glob pattern: *
Traceback (most recent call last):
File "/Users/jcarmony/git/projects/salt/salt/salt/utils/minions.py", line 450, in check_minions
}[expr_form](expr)
File "/Users/jcarmony/git/projects/salt/salt/salt/utils/minions.py", line 104, in _check_glob_minions
os.chdir(os.path.join(self.opts['pki_dir'], self.acc))
OSError: [Errno 2] No such file or directory: '/Users/jcarmony/salt/test_ssh/config/etc/salt/pki/master/minions'
```

salt-ssh will continue to run and match against the roster. This patch is simply to prevent this error by having it check before the chdir.