Skip to content
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.

Commit

Permalink
ensure that db_index is never None on RedisSettings (#1427)
Browse files Browse the repository at this point in the history
* ensure db_index is never `None`

* update changelog
  • Loading branch information
TheAndrewJackson authored Oct 17, 2022
1 parent da6fe5f commit 577cb6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ The types of changes are:
* `Security` in case of vulnerabilities.

## [Unreleased](https://github.com/ethyca/fidesops/compare/1.8.1...main)

### Changed
* Fix redis `db_index` config issue [#1427](https://github.com/ethyca/fidesops/pull/1427)

## [1.8.0](https://github.com/ethyca/fidesops/compare/1.8.0...1.8.1)

Expand Down
3 changes: 2 additions & 1 deletion src/fidesops/ops/core/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ def assemble_connection_url(
# If the whole URL is provided via the config, preference that
return v

return f"redis://{quote_plus(values.get('user', ''))}:{quote_plus(values.get('password', ''))}@{values.get('host', '')}:{values.get('port', '')}/{values.get('db_index', '')}"
db_index = values.get("db_index") if values.get("db_index") is not None else ""
return f"redis://{quote_plus(values.get('user', ''))}:{quote_plus(values.get('password', ''))}@{values.get('host', '')}:{values.get('port', '')}/{db_index}"

class Config:
env_prefix = "FIDESOPS__REDIS__"
Expand Down

0 comments on commit 577cb6e

Please sign in to comment.