From 62f49120cd1c0e7af9d71b8da14b0bc9b21b05ed Mon Sep 17 00:00:00 2001 From: Toshio Kuratomi Date: Wed, 13 Sep 2017 20:50:47 -0700 Subject: [PATCH] Fix regression in format of lvm facts (#30326) lvm information should not have leading whitespace in the key names Fixes #30006 --- lib/ansible/module_utils/facts/hardware/linux.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/ansible/module_utils/facts/hardware/linux.py b/lib/ansible/module_utils/facts/hardware/linux.py index 449b0e855f..95b03355d3 100644 --- a/lib/ansible/module_utils/facts/hardware/linux.py +++ b/lib/ansible/module_utils/facts/hardware/linux.py @@ -671,7 +671,7 @@ class LinuxHardware(Hardware): if vgs_path: rc, vg_lines, err = self.module.run_command('%s %s' % (vgs_path, lvm_util_options)) for vg_line in vg_lines.splitlines(): - items = vg_line.split(',') + items = vg_line.strip().split(',') vgs[items[0]] = {'size_g': items[-2], 'free_g': items[-1], 'num_lvs': items[2], @@ -684,7 +684,7 @@ class LinuxHardware(Hardware): if lvs_path: rc, lv_lines, err = self.module.run_command('%s %s' % (lvs_path, lvm_util_options)) for lv_line in lv_lines.splitlines(): - items = lv_line.split(',') + items = lv_line.strip().split(',') lvs[items[0]] = {'size_g': items[3], 'vg': items[1]} pvs_path = self.module.get_bin_path('pvs') @@ -693,7 +693,7 @@ class LinuxHardware(Hardware): if pvs_path: rc, pv_lines, err = self.module.run_command('%s %s' % (pvs_path, lvm_util_options)) for pv_line in pv_lines.splitlines(): - items = pv_line.split(',') + items = pv_line.strip().split(',') pvs[self._find_mapper_device_name(items[0])] = { 'size_g': items[4], 'free_g': items[5],