From 42730cffc4f4058cca42da9e9eb1415d7eb753e3 Mon Sep 17 00:00:00 2001 From: Claude Dioudonnat Date: Tue, 8 May 2018 15:52:28 +0200 Subject: [PATCH] Fix get_fs_size for LVM filesystem --- lib/ansible/modules/system/filesystem.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ansible/modules/system/filesystem.py b/lib/ansible/modules/system/filesystem.py index 0eb9f60919..16df042f3a 100644 --- a/lib/ansible/modules/system/filesystem.py +++ b/lib/ansible/modules/system/filesystem.py @@ -307,8 +307,8 @@ class LVM(Filesystem): def get_fs_size(self, dev): cmd = self.module.get_bin_path('pvs', required=True) - _, size, _ = self.module.run_command([cmd, '--noheadings', '-o', 'pv_size', '--units', 'b', str(dev)], check_rc=True) - block_count = int(size[:-1]) # block size is 1 + _, size, _ = self.module.run_command([cmd, '--noheadings', '-o', 'pv_size', '--units', 'b', '--nosuffix', str(dev)], check_rc=True) + block_count = int(size) return block_count