Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pull request update/241021 #436

Merged
merged 2 commits into from
Oct 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 10 additions & 14 deletions diworker/diworker/importers/azure.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,19 +213,9 @@ def _load_raw_usage_data(self, prices):
# collect all usage parts without them being overwritten by each
# other. Later, on clean expense generation, all entries for one
# day will be summed together.
try:
daily_usages = self._get_day_raw_usage(current_day)
except AzureErrorResponseException as exc:
code = getattr(exc.error, 'additional_properties', {}).get(
'error', {}).get('code')
if code == 'SubscriptionNotFound':
msg = exc.error.additional_properties['error'].get(
'message')
raise AzureResourceNotFoundError(msg)
else:
raise exc
record_number = 0
try:
daily_usages = self._get_day_raw_usage(current_day)
for usage_obj in daily_usages:
usage_dict = usage_obj.as_dict()
inst_data = json.loads(usage_dict.get('instance_data', '{}'))
Expand All @@ -252,11 +242,17 @@ def _load_raw_usage_data(self, prices):
self.update_raw_records(chunk)
chunk = []
except AzureErrorResponseException as ex:
code = getattr(ex.error, 'additional_properties', {}).get(
'error', {}).get('code')
if code == 'SubscriptionNotFound':
msg = ex.error.additional_properties['error'].get(
'message')
raise AzureResourceNotFoundError(msg)
error_message = str(ex)
if 'Unknown error' in error_message:
LOG.error('No ready reports yet in cloud for %s. Will skip the '
'remaining report import days and try next time'
' later.', current_day)
LOG.error('No ready reports yet in cloud for %s. Will '
'skip the remaining report import days and try '
'next time later.', current_day)
break
raise
current_day += timedelta(days=1)
Expand Down
2 changes: 1 addition & 1 deletion rest_api/rest_api_server/handlers/v2/profiling/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@ async def delete(self, organization_id, id, **kwargs):
Not found:
- OE0002: Object not found
security:
- token: []
- secret: []
"""
self.check_cluster_secret()
token = await self._get_profiling_token(organization_id)
Expand Down
Loading