Skip to content

Commit

Permalink
change api to error
Browse files Browse the repository at this point in the history
  • Loading branch information
JessicaS11 committed Feb 6, 2024
1 parent 0b88005 commit 7c5e027
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
1 change: 1 addition & 0 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ name: earthaccess
channels:
- conda-forge
dependencies:
- boto3
- python=3.9
- xarray>=0.19
- dask>=2022.1
Expand Down
7 changes: 4 additions & 3 deletions earthaccess/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -371,7 +371,8 @@ def in_us_west_2() -> str:
str: string indicating if the user is in AWS region us-west-2
"""
if earthaccess.__store__._running_in_us_west_2() is True:
msg = "You are running in AWS region 'us-west-2'"
return "You are running in AWS region 'us-west-2'"
else:
msg = "You are not running in AWS region 'us-west-2'"
return msg
raise ValueError('Your instance is not running inside the'
' AWS us-west-2 region.'
' You will not be able to directly access NASA Earthdata S3 buckets')
4 changes: 1 addition & 3 deletions earthaccess/store.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,7 @@ def _running_in_us_west_2(self) -> bool:
if (boto3.client('s3').meta.region_name == 'us-west-2'):
return True
else:
raise ValueError('Your instance is not running inside the'
' AWS us-west-2 region.'
' You will not be able to directly access NASA Earthdata S3 buckets')
return False

def set_requests_session(
self, url: str, method: str = "get", bearer_token: bool = False
Expand Down

0 comments on commit 7c5e027

Please sign in to comment.