You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Prior to this commit a logical volume that was a substring of the name of a volume group could not be created due to a false positive by the `exists?` method of the provider.
The sample output of `lvs` in the spec tests was updated to this:
```
LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert
lv_root VolGroup -wi-ao---- 18.54g
lv_swap VolGroup -wi-ao---- 992.00m
data data -wi-ao---- 992.00m
j1 vg_jenkins -wi-a----- 1.00g
```
After adding a test to verify that a logical volume named `jenkins` does not exist the original `exists?` check failed like so:
```
Puppet::Type::Logical_volume::ProviderLvm
self.instances
returns an array of logical volumes
when checking existence
returns 'true', lv 'data' in vg 'data' exists
returns 'nil', lv 'jenkins' in vg 'vg_jenkins' exists (FAILED - 5)
returns 'nil', lv 'data' in vg 'myvg' does not exist
```
After updating the `exists?` method to instead use `lvs_pattern` the new tests passes:
```
Puppet::Type::Logical_volume::ProviderLvm
self.instances
returns an array of logical volumes
when checking existence
returns 'true', lv 'data' in vg 'data' exists
returns 'nil', lv 'jenkins' in vg 'vg_jenkins' exists
returns 'nil', lv 'data' in vg 'myvg' does not exist
```
Co-authored-by: Ruediger Pluem <[email protected]>
0 commit comments