dotcloud/docker-registry — pull request #444 by dmp42 (2014-06-23 13:20:53+00:00)
Title: Config rehaul

This is mainly to fix our various problems with configuration typage/env that grew sore in the aftermath of the standalone True debacle:
* #423
* #431 (finally making @petermatic happy)

Incidentally, this also lay code to fix #440 and does fix #442.

BEWARE that the Configuration object behavior *changed* and that this *may* have unexpected and tricky impact, so, please review (ping my favorite-eagle-eyed @shin- and @wking) and if possible *test*.

Please note I'm not changing for the sake of it - I'm changing so that we have something that behaves rationally - and that we know exactly how.

In a nutshell:
* environment derived values are now typed properly (eg: they are YAML parsed) - which means `MY_ENV_VAR=True` will give `True` and `MY_ENV_VAR='["foo", "bar"]'` will give a python list, etc
* default values (for env derived values) are now typed properly (same as above)
* the config object is now usable with dot notation, as deep as there is values. eg: `cfg.foo.bar.baz`
* dict values are themselves instances of the Config class
* a non existent key with return `None`
* falsy values are no longer coalesced
* the `common` flavor is no longer forcefully inherited inside python code, but the heritage is declared using YAML - this is **DEFINITELY** a point where you need to update configuration files and that will break for people not paying attention
* as long as a key exists in YAML, it WILL be returned (eventually `None`) - this is an important change from the previous behavior where falsy values would mean the key is not returned at all (propagating to the parent dict which in turn might have returned `None` previously if no key were Trusy). This is especially true for the mirroring and cache config (code has been adjusted)
* we now have extensive tests to characterize all this
* default values were previously scattered (half in code, half in config.yaml). This is no longer the case, and all defaults are now specified in the config file. This *WILL* break for people not paying attention, specially the redis configuration which no longer makes "default" assumptions

@shin-: do we need `config/config_mirroring.yml` anymore? or can I remove it?