saltstack/salt — pull request #5663 by basepi (2013-06-20 22:57:18+00:00)
Title: Prioritize environmnt variable config location over default, Fix #5631

Except for the exception below, Salt will use the path passed in by `-c` if available, falling back first to the environment variable, and then to the default path if all else fails.

Exception:

If you define an environment variable like `SALT_MASTER_CONFIG=/root/master` and then try to use the default config location with `-c`:

```
salt-master -c /etc/salt
```

Then it still uses the environment variable. This is because I only override the environment variable if the passed-in path is not the default path. (See line 410 of the diff) I'm not sure how else to detect if `-c` was passed in without passing around some sort of flag. Any suggestions would be appreciated.