From 18687a383bdd99ceab5060e4741e98e955df1564 Mon Sep 17 00:00:00 2001 From: MelloCaique Date: Fri, 3 Dec 2021 14:35:02 +0000 Subject: [PATCH] Fix log message error in capacity filter This patch fixes a key error in the capacity filter log message. The Bug is due to a location change in the `msg_args` resulting in a key error in the attribute `requested`. Closes-Bug: #1953168 Change-Id: I41080795cc1c3c91de1e35d6d6eba3f05068b26e --- cinder/scheduler/filters/capacity_filter.py | 9 +++------ ...168-fix-capacity-filter-message-456dea41fa8a4a1b.yaml | 5 +++++ 2 files changed, 8 insertions(+), 6 deletions(-) create mode 100644 releasenotes/notes/bug-1953168-fix-capacity-filter-message-456dea41fa8a4a1b.yaml diff --git a/cinder/scheduler/filters/capacity_filter.py b/cinder/scheduler/filters/capacity_filter.py index 62e349d8ef8..d1eb7fb7bea 100644 --- a/cinder/scheduler/filters/capacity_filter.py +++ b/cinder/scheduler/filters/capacity_filter.py @@ -155,16 +155,13 @@ class CapacityFilter(filters.BaseBackendFilter): # of reserved space) which we can over-subscribe. adjusted_free_virtual = ( free * backend_state.max_over_subscription_ratio) - msg_args = {"available": adjusted_free_virtual, - "size": requested_size, - "grouping": grouping, - "grouping_name": backend_state.backend_id} + msg_args["available"] = adjusted_free_virtual res = adjusted_free_virtual >= requested_size if not res: LOG.warning("Insufficient free virtual space " "(%(available)sGB) to accommodate thin " - "provisioned %(size)sGB volume on %(grouping)s" - " %(grouping_name)s.", msg_args) + "provisioned %(requested)sGB volume on " + "%(grouping)s %(grouping_name)s.", msg_args) else: LOG.debug("Space information for volume creation " "on %(grouping)s %(grouping_name)s " diff --git a/releasenotes/notes/bug-1953168-fix-capacity-filter-message-456dea41fa8a4a1b.yaml b/releasenotes/notes/bug-1953168-fix-capacity-filter-message-456dea41fa8a4a1b.yaml new file mode 100644 index 00000000000..e7b0e4bb661 --- /dev/null +++ b/releasenotes/notes/bug-1953168-fix-capacity-filter-message-456dea41fa8a4a1b.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + `Bug #1953168 `_: Fixed + miss parameter in the capacity filter log message.