Skip to content

Commit

Permalink
have debug messages instead of throwing error for missing do errors f…
Browse files Browse the repository at this point in the history
…or CI
  • Loading branch information
asaiacai committed Nov 27, 2024
1 parent 3d63531 commit 0925f45
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions sky/provision/do/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,16 @@ def _init_client():
credentials_found += 1
logger.debug(f'Digital Ocean credential path found at {path}')
if not credentials_found == 1:
raise DigitalOceanError(
logger.debug(
(f'{credentials_found} credentials '
'found. Expected 1 credential. Please ',
'try setting a new API token with `doctl auth init`'))
return None
if CREDENTIALS_PATH is None:
raise DigitalOceanError(
logger.debug(
'no credentials file found from '
f'the following paths {POSSIBLE_CREDENTIALS_PATHS}')
return None

# attempt default context
credentials = common_utils.read_yaml(CREDENTIALS_PATH)
Expand All @@ -90,7 +92,7 @@ def _init_client():
except do.exceptions().HttpResponseError:
continue
else:
raise DigitalOceanError(
logger.debug(
'no valid api tokens found try '
'setting a new API token with `doctl auth init`')
return _client
Expand Down

0 comments on commit 0925f45

Please sign in to comment.