From 61244f6059d37ac0f7dabfc7eee3acfce78fbc10 Mon Sep 17 00:00:00 2001 From: Luciano Lo Giudice Date: Fri, 3 Sep 2021 18:13:14 -0300 Subject: [PATCH] Use '--yes' and 'check_call' instead of 'Popen' and 'communicate'. --- charmhelpers/contrib/storage/linux/lvm.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/charmhelpers/contrib/storage/linux/lvm.py b/charmhelpers/contrib/storage/linux/lvm.py index 36f5a1dff..89c47b9e9 100644 --- a/charmhelpers/contrib/storage/linux/lvm.py +++ b/charmhelpers/contrib/storage/linux/lvm.py @@ -58,9 +58,7 @@ def remove_lvm_physical_volume(block_device): :param block_device: str: Full path of block device to scrub. ''' - p = Popen(['pvremove', '-ff', block_device], - stdin=PIPE) - p.communicate(input=b'y\n') + check_call(['pvremove', '-ff', '--yes', block_device]) def list_lvm_volume_group(block_device):