Skip to content

Commit

Permalink
Make VG determination in Blivet.newLV() less cryptic
Browse files Browse the repository at this point in the history
The new LV's parent may be a VG or a thin pool depending on the type of the new
LV. Let's call this object 'parent' instead of 'vg' which is way less confusing.
  • Loading branch information
vpodzime committed Jul 31, 2015
1 parent 0e5bb60 commit a784428
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions blivet/blivet.py
Expand Up @@ -917,10 +917,12 @@ def newLV(self, *args, **kwargs):
"""
thin_volume = kwargs.pop("thin_volume", False)
thin_pool = kwargs.pop("thin_pool", False)
vg = kwargs.get("parents", [None])[0]
if thin_volume and vg:
parent = kwargs.get("parents", [None])[0]
if thin_volume and parent:
# kwargs["parents"] will contain the pool device, so...
vg = vg.vg
vg = parent.vg
else:
vg = parent

mountpoint = kwargs.pop("mountpoint", None)
if 'fmt_type' in kwargs:
Expand Down

0 comments on commit a784428

Please sign in to comment.