Skip to content

Commit

Permalink
Do not raise an error if hosts file is missing, only if it is invalid (
Browse files Browse the repository at this point in the history
…#177)

* Do not raise an error if hosts file is missing, only if it is invalid

* Updated changelog
  • Loading branch information
renatav authored Aug 16, 2021
1 parent 6f4952a commit 3529e38
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,23 @@ The format is based on [Keep a Changelog][keepachangelog],
and this project adheres to [Semantic Versioning][semver].




## [Unreleased]

### Added


### Changed

- Do not raise an error if the hosts file is missing ([177])

### Fixed


[177]: https://github.com/openlawlibrary/taf/pull/177


## [0.10.0] - 07/20/2021

### Added
Expand Down
5 changes: 4 additions & 1 deletion taf/hosts.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,10 @@ def set_hosts_of_repo(auth_repo, hosts):
def load_hosts_json(auth_repo, commit=None):
if commit is None:
commit = auth_repo.top_commit_of_branch(auth_repo.default_branch)
return _get_json_file(auth_repo, HOSTS_JSON_PATH, commit)
try:
return _get_json_file(auth_repo, HOSTS_JSON_PATH, commit)
except MissingHostsError:
return {}


def _get_json_file(auth_repo, path, commit):
Expand Down

0 comments on commit 3529e38

Please sign in to comment.