Skip to content

Commit f5823b0

Browse files
authored
Merge pull request #82 from stackhpc/upstream/master-2026-03-03
Synchronise master with upstream
2 parents bf81a9f + 44a81fe commit f5823b0

5 files changed

Lines changed: 66 additions & 30 deletions

File tree

cloudkittydashboard/dashboards/admin/hashmap/views.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# under the License.
1414

1515

16+
from cloudkittyclient import exc as ck_exc
1617
from django.urls import reverse
1718
from django.urls import reverse_lazy
1819
from django.utils.translation import gettext_lazy as _
@@ -41,7 +42,7 @@ def get_data(self):
4142
try:
4243
service = manager.info.get_metric(metric_name=s['name'])
4344
unit = service['unit']
44-
except exceptions.NotFound:
45+
except (exceptions.NotFound, ck_exc.HTTPNotFound):
4546
unit = "-"
4647

4748
list_services.append({

cloudkittydashboard/dashboards/admin/summary/tables.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,12 @@ class Meta(object):
3737

3838

3939
class TenantSummaryTable(tables.DataTable):
40-
res_type = tables.Column('res_type', verbose_name=_("Res Type"))
40+
res_type = tables.Column('type', verbose_name=_("Resource Type"))
4141
rate = tables.Column('rate', verbose_name=_("Rate"))
4242

4343
class Meta(object):
4444
name = "tenant_summary"
4545
verbose_name = _("Project Summary")
46+
47+
def get_object_id(self, datum):
48+
return datum.get('type')

cloudkittydashboard/dashboards/admin/summary/views.py

Lines changed: 31 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -33,49 +33,54 @@ class IndexView(tables.DataTableView):
3333
table_class = sum_tables.SummaryTable
3434

3535
def get_data(self):
36-
summary = api.cloudkittyclient(self.request).report.get_summary(
37-
groupby=['tenant_id'], all_tenants=True)['summary']
36+
summary = api.cloudkittyclient(
37+
self.request, version='2').summary.get_summary(
38+
groupby=['project_id'],
39+
response_format='object')
3840

39-
tenants, _ = api_keystone.tenant_list(self.request)
41+
tenants, unused = api_keystone.tenant_list(self.request)
4042
tenants = {tenant.id: tenant.name for tenant in tenants}
41-
summary.append({
42-
'tenant_id': 'ALL',
43-
'rate': sum([float(item['rate']) for item in summary]),
43+
data = summary.get('results')
44+
45+
total = sum([r.get('rate') for r in data])
46+
data.append({
47+
'project_id': 'ALL',
48+
'rate': total,
4449
})
45-
summary = api.identify(summary, key='tenant_id')
46-
for tenant in summary:
50+
data = api.identify(data, key='project_id')
51+
for tenant in data:
52+
tenant['tenant_id'] = tenant.get('project_id')
4753
tenant['name'] = tenants.get(tenant.id, '-')
48-
summary[-1]['name'] = 'Cloud Total'
49-
for tenant in summary:
5054
tenant['rate'] = utils.formatRate(tenant['rate'],
5155
rate_prefix, rate_postfix)
52-
return summary
56+
data[-1]['name'] = _('Cloud Total')
57+
return data
5358

5459

5560
class TenantDetailsView(tables.DataTableView):
5661
template_name = 'admin/rating_summary/details.html'
5762
table_class = sum_tables.TenantSummaryTable
5863
page_title = _("Script details: {{ table.project_id }}")
5964

60-
def _get_cloud_total_summary(self):
61-
return api.cloudkittyclient(self.request).report.get_summary(
62-
groupby=['res_type'], all_tenants=True)['summary']
63-
6465
def get_data(self):
6566
tenant_id = self.kwargs['project_id']
67+
6668
if tenant_id == 'ALL':
67-
summary = self._get_cloud_total_summary()
69+
summary = api.cloudkittyclient(
70+
self.request, version='2').summary.get_summary(
71+
groupby=['type'], response_format='object')
6872
else:
69-
summary = api.cloudkittyclient(self.request).report.get_summary(
70-
groupby=['res_type'], tenant_id=tenant_id)['summary']
73+
summary = api.cloudkittyclient(
74+
self.request, version='2').summary.get_summary(
75+
filters={'project_id': tenant_id},
76+
groupby=['type'], response_format='object')
7177

72-
summary.append({
73-
'tenant_id': tenant_id,
74-
'res_type': 'TOTAL',
75-
'rate': sum([float(item['rate']) for item in summary]),
76-
})
77-
summary = api.identify(summary, key='res_type', name=True)
78-
for item in summary:
78+
data = summary.get('results')
79+
total = sum([r.get('rate') for r in data])
80+
data.append({'type': 'TOTAL', 'rate': total})
81+
82+
for item in data:
7983
item['rate'] = utils.formatRate(item['rate'],
8084
rate_prefix, rate_postfix)
81-
return summary
85+
86+
return data
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
upgrade:
3+
- |
4+
Upgrades the CloudKitty API from v1 to v2 in the admin/rating panel.
5+

releasenotes/source/locale/en_GB/LC_MESSAGES/releasenotes.po

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
# Andi Chandler <andi@gowling.com>, 2022. #zanata
66
# Andi Chandler <andi@gowling.com>, 2023. #zanata
77
# Andi Chandler <andi@gowling.com>, 2024. #zanata
8+
# Andi Chandler <andi@gowling.com>, 2026. #zanata
89
msgid ""
910
msgstr ""
1011
"Project-Id-Version: Cloudkitty Dashboard Release Notes\n"
1112
"Report-Msgid-Bugs-To: \n"
12-
"POT-Creation-Date: 2025-08-07 10:32+0000\n"
13+
"POT-Creation-Date: 2025-11-26 12:19+0000\n"
1314
"MIME-Version: 1.0\n"
1415
"Content-Type: text/plain; charset=UTF-8\n"
1516
"Content-Transfer-Encoding: 8bit\n"
16-
"PO-Revision-Date: 2024-04-18 12:35+0000\n"
17+
"PO-Revision-Date: 2026-01-07 11:22+0000\n"
1718
"Last-Translator: Andi Chandler <andi@gowling.com>\n"
1819
"Language-Team: English (United Kingdom)\n"
1920
"Language: en_GB\n"
@@ -29,6 +30,9 @@ msgstr "11.0.1"
2930
msgid "12.0.0"
3031
msgstr "12.0.0"
3132

33+
msgid "12.0.0-4"
34+
msgstr "12.0.0-4"
35+
3236
msgid "13.0.0"
3337
msgstr "13.0.0"
3438

@@ -38,6 +42,9 @@ msgstr "14.0.1"
3842
msgid "15.0.0"
3943
msgstr "15.0.0"
4044

45+
msgid "19.0.0"
46+
msgstr "19.0.0"
47+
4148
msgid "2023.1 Series Release Notes"
4249
msgstr "2023.1 Series Release Notes"
4350

@@ -47,6 +54,18 @@ msgstr "2023.2 Series Release Notes"
4754
msgid "2024.1 Series Release Notes"
4855
msgstr "2024.1 Series Release Notes"
4956

57+
msgid "2024.2 Series Release Notes"
58+
msgstr "2024.2 Series Release Notes"
59+
60+
msgid "2025.1 Series Release Notes"
61+
msgstr "2025.1 Series Release Notes"
62+
63+
msgid "2025.2 Series Release Notes"
64+
msgstr "2025.2 Series Release Notes"
65+
66+
msgid "21.0.0"
67+
msgstr "21.0.0"
68+
5069
msgid "8.1.0"
5170
msgstr "8.1.0"
5271

@@ -136,6 +155,9 @@ msgstr "Rocky Series Release Notes"
136155
msgid "Stein Series Release Notes"
137156
msgstr "Stein Series Release Notes"
138157

158+
msgid "Support for Python 3.8 and 3.9 has been dropped."
159+
msgstr "Support for Python 3.8 and 3.9 has been dropped."
160+
139161
msgid ""
140162
"The \"Cost Per Service Per Hour\" graph no longer stacks series on the Y "
141163
"axis."

0 commit comments

Comments
 (0)