def load(kind=None):
    """Returns the right storage class according to the configuration."""
    global _storage
    cfg = config.load()
    if not kind:
        kind = cfg.storage.lower()
    if kind == 'local':
        kind = 'file'
    if kind in _storage:
        return _storage[kind]

    _storage[kind] = engine.fetch(kind)(
        path=cfg.storage_path,
        config=cfg)

    return _storage[kind]
Returns the right storage class according to the configuration.
docker_registry/storage/__init__.py