From: Sage Weil Date: Tue, 18 Dec 2018 22:22:39 +0000 (-0600) Subject: mgr/pg_autoscaler: simplify conditions X-Git-Tag: v14.1.0~582^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=431d9b86992bd5633f50b231d63c90394a22b047;p=ceph.git mgr/pg_autoscaler: simplify conditions Signed-off-by: Sage Weil --- diff --git a/src/pybind/mgr/pg_autoscaler/module.py b/src/pybind/mgr/pg_autoscaler/module.py index b11ba8eed308..7547979390a3 100644 --- a/src/pybind/mgr/pg_autoscaler/module.py +++ b/src/pybind/mgr/pg_autoscaler/module.py @@ -389,7 +389,7 @@ class PgAutoscaler(MgrModule): .format(p['pool_name'], p['pg_num_final'], r)) - if len(too_few): + if too_few: summary = "{0} pools have too few placement groups".format( len(too_few)) health_checks['POOL_TOO_FEW_PGS'] = { @@ -397,7 +397,7 @@ class PgAutoscaler(MgrModule): 'summary': summary, 'detail': too_few } - if len(too_many): + if too_many: summary = "{0} pools have too many placement groups".format( len(too_many)) health_checks['POOL_TOO_MANY_PGS'] = { @@ -426,7 +426,7 @@ class PgAutoscaler(MgrModule): total_target ) ) - if len(too_much_target_ratio): + if too_much_target_ratio: health_checks['POOL_TARGET_SIZE_RATIO_OVERCOMMITTED'] = { 'severity': 'warning', 'summary': "%d subtrees have overcommitted pool target_size_ratio" % len(too_much_target_ratio), @@ -455,7 +455,7 @@ class PgAutoscaler(MgrModule): mgr_util.format_bytes(total_target, 5, colored=False), ) ) - if len(too_much_target_bytes): + if too_much_target_bytes: health_checks['POOL_TARGET_SIZE_BYTES_OVERCOMMITTED'] = { 'severity': 'warning', 'summary': "%d subtrees have overcommitted pool target_size_bytes" % len(too_much_target_bytes),