Skip to content

Commit 517305f

Browse files
fix: broken app logger calls (#550)
1 parent f37eb05 commit 517305f

File tree

2 files changed

+15
-13
lines changed

2 files changed

+15
-13
lines changed

app/controllers/project.py

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,10 @@ def post(self):
178178
log_activity('Project', status='Success',
179179
operation='Create',
180180
description='Created project Successfully',
181-
a_project_id=project.id,
182-
a_cluster_id=cluster_id)
181+
a_project=project.id,
182+
a_cluster_id=cluster_id,
183+
184+
)
183185

184186
return dict(status='success', data=dict(project=new_project_data)), 201
185187

@@ -467,14 +469,14 @@ def delete(self, project_id):
467469
log_activity('Project', status='Failed',
468470
operation='Delete',
469471
description='Internal server error',
470-
a_project_id=project_id,
472+
a_project=project_id,
471473
a_cluster_id=project.cluster_id)
472474
return dict(status='fail', message='deletion failed'), 500
473475

474476
log_activity('Project', status='Success',
475477
operation='Delete',
476478
description='Deleted project Successfully',
477-
a_project_id=project.id,
479+
a_project=project.id,
478480
a_cluster_id=project.cluster_id)
479481
return dict(
480482
status='success',
@@ -499,7 +501,7 @@ def delete(self, project_id):
499501
log_activity('Project', status='Success',
500502
operation='Delete',
501503
description='Deleted project Successfully',
502-
a_project_id=project.id,
504+
a_project=project.id,
503505
a_cluster_id=project.cluster_id)
504506
return dict(
505507
status='success',
@@ -508,15 +510,15 @@ def delete(self, project_id):
508510
log_activity('Project', status='Failed',
509511
operation='Delete',
510512
description=e.reason,
511-
a_project_id=project_id,
513+
a_project=project_id,
512514
a_cluster_id=project.cluster_id)
513515
return dict(status='fail', message=e.reason), check_kube_error_code(e.status)
514516

515517
except Exception as e:
516518
log_activity('Project', status='Failed',
517519
operation='Delete',
518520
description=str(e),
519-
a_project_id=project_id,
521+
a_project=project_id,
520522
a_cluster_id=project.cluster_id)
521523
return dict(status='fail', message=str(e)), 500
522524

@@ -568,15 +570,15 @@ def patch(self, project_id):
568570
log_activity('Project', status='Failed',
569571
operation='Update',
570572
description='Internal Server Error',
571-
a_project_id=project.id,
573+
a_project=project.id,
572574
a_cluster_id=project.cluster_id
573575
)
574576
return dict(status='fail', message='internal server error'), 500
575577

576578
log_activity('Project', status='Success',
577579
operation='Update',
578580
description='Updated project Successfully',
579-
a_project_id=project.id,
581+
a_project=project.id,
580582
a_cluster_id=project.cluster_id)
581583
return dict(
582584
status='success',

app/helpers/kube.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -620,7 +620,7 @@ def disable_user_app(app: App, is_admin=False):
620620
log_activity('App', status='Success',
621621
operation='Disable',
622622
description='Disabled app Successfully',
623-
a_project_id=app.project.id,
623+
a_project=app.project.id,
624624
a_cluster_id=app.project.cluster_id)
625625
return True
626626

@@ -629,7 +629,7 @@ def disable_user_app(app: App, is_admin=False):
629629
log_activity('App', status='Failed',
630630
operation='Disable',
631631
description='Error disabling application',
632-
a_project_id=app.project.id,
632+
a_project=app.project.id,
633633
a_cluster_id=app.project.cluster_id)
634634
return SimpleNamespace(
635635
message=json.loads(e.body),
@@ -675,7 +675,7 @@ def enable_user_app(app: App):
675675
log_activity('App', status='Success',
676676
operation='Enable',
677677
description='Enabled app Successfully',
678-
a_project_id=app.project.id,
678+
a_project=app.project.id,
679679
a_cluster_id=app.project.cluster_id)
680680
return True
681681

@@ -684,7 +684,7 @@ def enable_user_app(app: App):
684684
log_activity('App', status='Failed',
685685
operation='Enable',
686686
description='Error enabling application',
687-
a_project_id=app.project.id,
687+
a_project=app.project.id,
688688
a_cluster_id=app.project.cluster_id)
689689
return SimpleNamespace(
690690
message=json.loads(e.body),

0 commit comments

Comments
 (0)