mirror of
https://github.com/vale981/ray
synced 2025-03-06 10:31:39 -05:00
When getting a role/profile, catch only exception that indicates the role/profile already exists, allow others to be raised (#3383)
This commit is contained in:
parent
24bfe8ab76
commit
b9ae5edf74
1 changed files with 3 additions and 2 deletions
|
@ -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
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue