Skip to content

Commit 95ae83d

Browse files
Zuulopenstack-gerrit
authored andcommitted
Merge "Fix quota error messages"
2 parents 25742da + 84a4c07 commit 95ae83d

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

octavia/db/repositories.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -584,7 +584,7 @@ def decrement_quota(self, lock_session, _class, project_id, quantity=1):
584584
LOG.error('Quota decrement on %(clss)s called on '
585585
'project: %(proj)s with no quota record in '
586586
'the database.',
587-
{'clss': type(_class), 'proj': project_id})
587+
{'clss': _class, 'proj': project_id})
588588
return
589589
if _class == data_models.LoadBalancer:
590590
if (quotas.in_use_load_balancer is not None and
@@ -596,7 +596,7 @@ def decrement_quota(self, lock_session, _class, project_id, quantity=1):
596596
LOG.warning('Quota decrement on %(clss)s called on '
597597
'project: %(proj)s that would cause a '
598598
'negative quota.',
599-
{'clss': type(_class), 'proj': project_id})
599+
{'clss': _class, 'proj': project_id})
600600
if _class == data_models.Listener:
601601
if (quotas.in_use_listener is not None and
602602
quotas.in_use_listener > 0):
@@ -607,7 +607,7 @@ def decrement_quota(self, lock_session, _class, project_id, quantity=1):
607607
LOG.warning('Quota decrement on %(clss)s called on '
608608
'project: %(proj)s that would cause a '
609609
'negative quota.',
610-
{'clss': type(_class), 'proj': project_id})
610+
{'clss': _class, 'proj': project_id})
611611
if _class == data_models.Pool:
612612
if (quotas.in_use_pool is not None and
613613
quotas.in_use_pool > 0):
@@ -618,7 +618,7 @@ def decrement_quota(self, lock_session, _class, project_id, quantity=1):
618618
LOG.warning('Quota decrement on %(clss)s called on '
619619
'project: %(proj)s that would cause a '
620620
'negative quota.',
621-
{'clss': type(_class), 'proj': project_id})
621+
{'clss': _class, 'proj': project_id})
622622
if _class == data_models.HealthMonitor:
623623
if (quotas.in_use_health_monitor is not None and
624624
quotas.in_use_health_monitor > 0):
@@ -629,7 +629,7 @@ def decrement_quota(self, lock_session, _class, project_id, quantity=1):
629629
LOG.warning('Quota decrement on %(clss)s called on '
630630
'project: %(proj)s that would cause a '
631631
'negative quota.',
632-
{'clss': type(_class), 'proj': project_id})
632+
{'clss': _class, 'proj': project_id})
633633
if _class == data_models.Member:
634634
if (quotas.in_use_member is not None and
635635
quotas.in_use_member > 0):
@@ -640,7 +640,7 @@ def decrement_quota(self, lock_session, _class, project_id, quantity=1):
640640
LOG.warning('Quota decrement on %(clss)s called on '
641641
'project: %(proj)s that would cause a '
642642
'negative quota.',
643-
{'clss': type(_class), 'proj': project_id})
643+
{'clss': _class, 'proj': project_id})
644644
if _class == data_models.L7Policy:
645645
if (quotas.in_use_l7policy is not None and
646646
quotas.in_use_l7policy > 0):
@@ -651,7 +651,7 @@ def decrement_quota(self, lock_session, _class, project_id, quantity=1):
651651
LOG.warning('Quota decrement on %(clss)s called on '
652652
'project: %(proj)s that would cause a '
653653
'negative quota.',
654-
{'clss': type(_class), 'proj': project_id})
654+
{'clss': _class, 'proj': project_id})
655655
if _class == data_models.L7Rule:
656656
if (quotas.in_use_l7rule is not None and
657657
quotas.in_use_l7rule > 0):
@@ -662,7 +662,7 @@ def decrement_quota(self, lock_session, _class, project_id, quantity=1):
662662
LOG.warning('Quota decrement on %(clss)s called on '
663663
'project: %(proj)s that would cause a '
664664
'negative quota.',
665-
{'clss': type(_class), 'proj': project_id})
665+
{'clss': _class, 'proj': project_id})
666666
except db_exception.DBDeadlock as e:
667667
LOG.warning('Quota project lock timed out for project: %(proj)s',
668668
{'proj': project_id})
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
fixes:
3+
- |
4+
Fixed the format of log messages related to quota decrement errors. They
5+
displayed unhelpful information, they now report the correct resource
6+
type for which the error occurs.

0 commit comments

Comments
 (0)