From 1ea1b9fb13a2ca3767cc0ce58b54144c63c01b17 Mon Sep 17 00:00:00 2001 From: Alexander Gubin Date: Wed, 12 Aug 2015 16:35:31 +0200 Subject: [PATCH] bugfix: missing path for lvm facts --- lib/ansible/module_utils/facts.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/ansible/module_utils/facts.py b/lib/ansible/module_utils/facts.py index 33026c879c..1d1c5a928b 100644 --- a/lib/ansible/module_utils/facts.py +++ b/lib/ansible/module_utils/facts.py @@ -1073,12 +1073,14 @@ class LinuxHardware(Hardware): """ Get LVM Facts if running as root and lvm utils are available """ if os.getuid() == 0 and module.get_bin_path('vgs'): + vgs_path = module.get_bin_path('vgs') + lvs_path = module.get_bin_path('lvs') lvm_util_options = '--noheadings --nosuffix --units g' #vgs fields: VG #PV #LV #SN Attr VSize VFree vgs={} rc, vg_lines, err = module.run_command( - 'vgs %s' % lvm_util_options) + '%s %s' % (vgs_path, lvm_util_options)) for vg_line in vg_lines.splitlines(): items = vg_line.split() vgs[items[0]] = {'size_g':items[-2], @@ -1090,7 +1092,7 @@ class LinuxHardware(Hardware): #LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert lvs = {} rc, lv_lines, err = module.run_command( - 'lvs %s' % lvm_util_options) + '%s %s' % (lvs_path, lvm_util_options)) for lv_line in lv_lines.splitlines(): items = lv_line.split() lvs[items[0]] = {'size_g': items[3],