Skip to content

Commit

Permalink
Fix an import issue introduced by aio-libs/aiobotocore#877 (#307)
Browse files Browse the repository at this point in the history
  • Loading branch information
gmorin committed Aug 25, 2021
1 parent a344aec commit fcc6cf3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions dask_cloudprovider/aws/ec2.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
from dask_cloudprovider.utils.timeout import Timeout

try:
import aiobotocore
from aiobotocore.session import get_session
import botocore.exceptions
except ImportError as e:
msg = (
Expand Down Expand Up @@ -407,7 +407,7 @@ def __init__(
debug=False,
**kwargs,
):
self.boto_session = aiobotocore.get_session()
self.boto_session = get_session()
self.config = dask.config.get("cloudprovider.ec2", {})
self.scheduler_class = EC2Scheduler
self.worker_class = EC2Worker
Expand Down
6 changes: 3 additions & 3 deletions dask_cloudprovider/aws/ecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@

try:
from botocore.exceptions import ClientError
import aiobotocore
from aiobotocore.session import get_session
except ImportError as e:
msg = (
"Dask Cloud Provider AWS requirements are not installed.\n\n"
Expand Down Expand Up @@ -729,7 +729,7 @@ def __init__(
self._region_name = region_name
self._platform_version = platform_version
self._lock = asyncio.Lock()
self.session = aiobotocore.get_session()
self.session = get_session()
super().__init__(**kwargs)

def _client(self, name: str):
Expand Down Expand Up @@ -1390,7 +1390,7 @@ async def _cleanup_stale_resources():
"""
# Clean up clusters (clusters with no running tasks)
session = aiobotocore.get_session()
session = get_session()
async with session.create_client("ecs") as ecs:
active_clusters = []
clusters_to_delete = []
Expand Down

0 comments on commit fcc6cf3

Please sign in to comment.