From b9ae5edf744265b6917a9946806e29db297854c1 Mon Sep 17 00:00:00 2001 From: GiliR4t1qbit Date: Thu, 22 Nov 2018 09:42:58 -0800 Subject: [PATCH] When getting a role/profile, catch only exception that indicates the role/profile already exists, allow others to be raised (#3383) --- python/ray/autoscaler/aws/config.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/ray/autoscaler/aws/config.py b/python/ray/autoscaler/aws/config.py index b6953c149..62e0b25ee 100644 --- a/python/ray/autoscaler/aws/config.py +++ b/python/ray/autoscaler/aws/config.py @@ -10,6 +10,7 @@ import time import boto3 from botocore.config import Config +import botocore from ray.ray_constants import BOTO_MAX_RETRIES @@ -272,7 +273,7 @@ def _get_role(role_name, config): try: role.load() return role - except Exception: + except botocore.errorfactory.NoSuchEntityException: return None @@ -282,7 +283,7 @@ def _get_instance_profile(profile_name, config): try: profile.load() return profile - except Exception: + except botocore.errorfactory.NoSuchEntityException: return None