Skip to content

Commit

Permalink
comment update
Browse files Browse the repository at this point in the history
landscapepainter committed Jun 8, 2024

Verified

This commit was signed with the committer’s verified signature.
oliverholworthy Oliver Holworthy
1 parent 119e7e5 commit ecbab0e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions sky/data/data_utils.py
Original file line number Diff line number Diff line change
@@ -247,7 +247,6 @@ def get_az_storage_account_key(
storage_client = create_az_client('storage')
attempt = 0
backoff = common_utils.Backoff()
logger.info('get_az_storage_account_key')
while True:
try:
resources = resource_client.resources.list_by_resource_group(
@@ -264,14 +263,16 @@ def get_az_storage_account_key(
]
storage_account_key = storage_account_keys[0]
return storage_account_key
# If storage account was created right before call to this method,
# it is possible to fail to retrieve the key as the creation did not
# propagate to Azure yet. We retry several times.
except UnboundLocalError as e:
attempt += 1
logger.info('failed to retrieve storage account name....')
if attempt > _STORAGE_ACCOUNT_KEY_RETRIEVE_MAX_ATTEMPT:
raise RuntimeError('Failed to obtain key value of storage '
f'account {storage_account_name}.\n'
f'Detailed error: {e}')
time.sleep(backoff.current_backoff())
time.sleep(backoff.current_backoff())


def create_r2_client(region: str = 'auto') -> Client:

0 comments on commit ecbab0e

Please sign in to comment.