Skip to content

Commit 7c5e027

Browse files
committed
change api to error
1 parent 0b88005 commit 7c5e027

File tree

3 files changed

+6
-6
lines changed

3 files changed

+6
-6
lines changed

binder/environment.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ name: earthaccess
22
channels:
33
- conda-forge
44
dependencies:
5+
- boto3
56
- python=3.9
67
- xarray>=0.19
78
- dask>=2022.1

earthaccess/api.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -371,7 +371,8 @@ def in_us_west_2() -> str:
371371
str: string indicating if the user is in AWS region us-west-2
372372
"""
373373
if earthaccess.__store__._running_in_us_west_2() is True:
374-
msg = "You are running in AWS region 'us-west-2'"
374+
return "You are running in AWS region 'us-west-2'"
375375
else:
376-
msg = "You are not running in AWS region 'us-west-2'"
377-
return msg
376+
raise ValueError('Your instance is not running inside the'
377+
' AWS us-west-2 region.'
378+
' You will not be able to directly access NASA Earthdata S3 buckets')

earthaccess/store.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -144,9 +144,7 @@ def _running_in_us_west_2(self) -> bool:
144144
if (boto3.client('s3').meta.region_name == 'us-west-2'):
145145
return True
146146
else:
147-
raise ValueError('Your instance is not running inside the'
148-
' AWS us-west-2 region.'
149-
' You will not be able to directly access NASA Earthdata S3 buckets')
147+
return False
150148

151149
def set_requests_session(
152150
self, url: str, method: str = "get", bearer_token: bool = False

0 commit comments

Comments
 (0)