From 8a7fa0d712abb95374e37a78fe0ae19446d99b55 Mon Sep 17 00:00:00 2001 From: Alex Schultz Date: Tue, 18 Sep 2018 17:37:12 -0600 Subject: [PATCH] Fix diskspace validation when size is the limit Previously if you had 25.5G free and the minimum should be 25, the task would fail. We do not want to fail when the amount of space free is equal to the minimum required space. We only want to fail when it's less than the required space. In this case the task needs to be updated to drop the equals from the failed_when so that if the amount free is equal to the minimum required amount then it will pass. Change-Id: I90b4a9617ba00610bee77af84bb1d12511ad452f Closes-Bug: #1793211 --- validations/tasks/disk_space.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/validations/tasks/disk_space.yaml b/validations/tasks/disk_space.yaml index 9e777816f..4ae8082f3 100644 --- a/validations/tasks/disk_space.yaml +++ b/validations/tasks/disk_space.yaml @@ -13,8 +13,8 @@ - name: loop on existing volumes, check available space fail: - msg: "Minimum required for {{ item.mount }}: {{ volumes | selectattr('mount', 'equalto', item.mount) | map(attribute='min_size') | list | join('') }}G - volume free space: {{ (item.size_available|int / const_bytes_in_gb|int) |round(1) }}" - failed_when: "(volumes | selectattr('mount', 'equalto', item.mount) | map(attribute='min_size') | list | join('')|int) >= (item.size_available|int / const_bytes_in_gb|int) |int" + msg: "Minimum required for {{ item.mount }}: {{ volumes | selectattr('mount', 'equalto', item.mount) | map(attribute='min_size') | list | join('') }}G - volume free space: {{ (item.size_available|int / const_bytes_in_gb|int) |round(1) }}G" + failed_when: "(volumes | selectattr('mount', 'equalto', item.mount) | map(attribute='min_size') | list | join('')|int) > (item.size_available|int / const_bytes_in_gb|int) |int" loop: "{{ a_mounts }}" loop_control: label: "{{ item.mount }}"