Add default value for lvm_facts when lvm or lvm2 is not installed or … (#75989)

* Add default value for lvm_facts when lvm or lvm2 is not installed or there are no lvm facts
pull/78259/head
Mahesh 2 years ago committed by GitHub
parent d58e69c82d
commit b2cde3a896
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -0,0 +1,2 @@
bugfixes:
- setup - Adds a default value to ``lvm_facts`` when lvm or lvm2 is not installed on linux (https://github.com/ansible/ansible/issues/17393)

@ -818,7 +818,7 @@ class LinuxHardware(Hardware):
def get_lvm_facts(self): def get_lvm_facts(self):
""" Get LVM Facts if running as root and lvm utils are available """ """ Get LVM Facts if running as root and lvm utils are available """
lvm_facts = {} lvm_facts = {'lvm': 'N/A'}
if os.getuid() == 0 and self.module.get_bin_path('vgs'): if os.getuid() == 0 and self.module.get_bin_path('vgs'):
lvm_util_options = '--noheadings --nosuffix --units g --separator ,' lvm_util_options = '--noheadings --nosuffix --units g --separator ,'

Loading…
Cancel
Save