Skip to content

_app/settings/parser.py: Fix validation without the `redis` package

Jürg Billeter requested to merge juerg/redis into master

Description

The redis package is marked as optional, however, schema validation of the configuration file currently fails without it. The reason is that the connections array accepts both, SQL and Redis connections, which means that type checks are invoked for both.

This issue broke the BuildGrid docker image with the default configuration.

Changes proposed in this merge request:

  • Catch ImportError in the redis provider type check. If RedisProvider cannot be imported, instance can't possibly be of type RedisProvider, so we can simply return False

Validation

BuildGrid should successfully start up with data/config/default.yml in an environment without the redis Python package.

Merge request reports