Skip to content

Commit

Permalink
Use '--yes' and 'check_call' instead of 'Popen' and 'communicate'.
Browse files Browse the repository at this point in the history
  • Loading branch information
lmlg committed Sep 3, 2021
1 parent 4af0d14 commit 61244f6
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions charmhelpers/contrib/storage/linux/lvm.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down

0 comments on commit 61244f6

Please sign in to comment.