mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Fix modules.linux_lvm.pvcreate on existing LVM PVs
If all the devices submitted to pvcreate() are already initialized as LVM physical volumes and override is True (which is default), pvcreate() should return True and no futher actions should be made. The 'not cmd[1:]' check which is suited for this scenario is incorrect, as we previously filled the 'cmd' list with two elements and thus the condition would be always False. This would cause pvcreate() to call the pvcreate executable with no arguments if all the submitted devices are already initialized as LVM PVs. Fixes #39070
This commit is contained in:
parent
0f84ca2487
commit
f1e3e86e6a
1 changed files with 1 additions and 1 deletions
|
@ -229,7 +229,7 @@ def pvcreate(devices, override=True, **kwargs):
|
|||
elif not override:
|
||||
raise CommandExecutionError('Device "{0}" is already an LVM physical volume.'.format(device))
|
||||
|
||||
if not cmd[1:]:
|
||||
if not cmd[2:]:
|
||||
# All specified devices are already LVM volumes
|
||||
return True
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue