mozilla-services/circus — pull request #560 by apmorton (2013-10-11 20:57:44+00:00)
Title: environment variable for socket port

consider this simple configuration

```
[watcher:web]
cmd = chaussette --fd $(circus.sockets.web) my.app
use_sockets = True

[socket:web]
host = 0.0.0.0
port = 5000
```

assume you are running circus in a 'heroku' like environment where the port can/will change on every startup.

```
[watcher:web]
cmd = chaussette --fd $(circus.sockets.web) my.app
use_sockets = True

[socket:web]
host = 0.0.0.0
port = $(CIRCUS.ENV.PORT)
```

unfortunately it seems variables are only expanded in watcher sections.

I think it would be a useful addition to expand variables from the `[env]` section and `os.environ` in ALL sections. watcher section behavior would not change, but all variables in socket/plugin sections could use variables from the `[env]` section and `os.environ`

what do you guys think? I would be able to add this pretty easily, but I wanted to see if anyone agrees before I submit a PR that wouldn't be merged.