Skip to content

Commit b72071a

Browse files
author
Naman Munet
committed
mgr/dashboard: Edit user via UI throwing multiple server errors
Fixes: https://tracker.ceph.com/issues/73637 Commit includes: Returning the default user ratelimit when the ratelimit for user is not set, hence eliminating the 500 error on UI Signed-off-by: Naman Munet <[email protected]>
1 parent 3b5b8da commit b72071a

File tree

2 files changed

+11
-1
lines changed

2 files changed

+11
-1
lines changed

src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-user-form/rgw-user-form.component.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ export class RgwUserFormComponent extends CdForm implements OnInit {
207207
const observables = [];
208208
observables.push(this.rgwUserService.get(uid));
209209
observables.push(this.rgwUserService.getQuota(uid));
210-
observables.push(this.rgwUserService.getUserRateLimit(uid));
211210
observableForkJoin(observables).subscribe(
212211
(resp: any[]) => {
213212
// Get the default values.

src/pybind/mgr/dashboard/services/rgw_client.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,15 @@
4747
_SYNC_GROUP_ID = 'dashboard_admin_group'
4848
_SYNC_FLOW_ID = 'dashboard_admin_flow'
4949
_SYNC_PIPE_ID = 'dashboard_admin_pipe'
50+
DEFAULT_USER_RATELIMIT = {
51+
"user_ratelimit": {
52+
"max_read_ops": 0,
53+
"max_write_ops": 0,
54+
"max_read_bytes": 0,
55+
"max_write_bytes": 0,
56+
"enabled": False
57+
}
58+
}
5059

5160

5261
class NoRgwDaemonsException(Exception):
@@ -1717,6 +1726,8 @@ def get_rateLimit(self, scope: str, name: str):
17171726
try:
17181727
exit_code, out, err = mgr.send_rgwadmin_command(rate_limit_cmd)
17191728
if exit_code > 0:
1729+
if "No such file or directory" in str(err):
1730+
return DEFAULT_USER_RATELIMIT
17201731
raise DashboardException(f'Unable to get rate limit: {err}',
17211732
http_status_code=500, component='rgw')
17221733
return out

0 commit comments

Comments
 (0)