Skip to content

Commit

Permalink
get token from overrides
Browse files Browse the repository at this point in the history
  • Loading branch information
epwalsh committed Dec 14, 2021
1 parent 0b0bd57 commit 2c53c2b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## Unreleased

### Fixed

- Fixed bug where `Beaker.from_env()` would fail with missing `BEAKER_TOKEN` even if you passed the token to the method.

## [v0.2.4](https://github.com/allenai/beaker-py/releases/tag/v0.2.4) - 2021-12-09

### Changed
Expand Down
4 changes: 3 additions & 1 deletion beaker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ def from_env(cls, **overrides) -> "Config":
config = cls(
user_token=os.environ[cls.TOKEN_KEY],
)
elif user_token in overrides:
config = cls(user_token=user_token)
else:
raise ConfigurationError(
f"Missing config file or environment variable '{cls.TOKEN_KEY}'"
f"Failed to find config file or environment variable '{cls.TOKEN_KEY}'"
)

# Override with environment variables.
Expand Down

0 comments on commit 2c53c2b

Please sign in to comment.