Brick LVM: Rename get_all_volumes, further optimize
This method can process all LVs, those in a VG, or an individual LV. Rename it to be more descriptive. Optimize update_volume_group_info check for thin pool. Remove volume.utils.get_all_volumes, which is unused. Remove fake_lvm.get_all_volumes and fake_lvm.get_all_volume_groups which don't appear to have correct signatures/returns and are unused. Change-Id: I412c62230517cbfc08cc0076aaeea45224e6b50e
This commit is contained in:
parent
dcda67053d
commit
2cb519dbd2
@ -233,8 +233,8 @@ class LVM(executor.Executor):
|
||||
return self._supports_lvchange_ignoreskipactivation
|
||||
|
||||
@staticmethod
|
||||
def get_all_volumes(root_helper, vg_name=None, lv_name=None):
|
||||
"""Static method to get all LV's on a system.
|
||||
def get_lv_info(root_helper, vg_name=None, lv_name=None):
|
||||
"""Retrieve info about LVs (all, in a VG, or a single LV).
|
||||
|
||||
:param root_helper: root_helper to use for execute
|
||||
:param vg_name: optional, gathers info for only the specified VG
|
||||
@ -273,9 +273,9 @@ class LVM(executor.Executor):
|
||||
:returns: List of Dictionaries with LV info
|
||||
|
||||
"""
|
||||
self.lv_list = self.get_all_volumes(self._root_helper,
|
||||
self.vg_name,
|
||||
lv_name)
|
||||
self.lv_list = self.get_lv_info(self._root_helper,
|
||||
self.vg_name,
|
||||
lv_name)
|
||||
return self.lv_list
|
||||
|
||||
def get_volume(self, name):
|
||||
@ -389,7 +389,9 @@ class LVM(executor.Executor):
|
||||
self.vg_uuid = vg_list[0]['uuid']
|
||||
|
||||
if self.vg_thin_pool is not None:
|
||||
for lv in self.get_all_volumes(self._root_helper, self.vg_name):
|
||||
for lv in self.get_lv_info(self._root_helper,
|
||||
self.vg_name,
|
||||
self.vg_thin_pool):
|
||||
if lv['name'] == self.vg_thin_pool:
|
||||
self.vg_thin_pool_size = lv['size']
|
||||
tpfs = self._get_thin_pool_free_space(self.vg_name,
|
||||
|
@ -27,11 +27,6 @@ class FakeBrickLVM(object):
|
||||
def supports_thin_provisioning():
|
||||
return False
|
||||
|
||||
def get_all_volumes(vg_name=None):
|
||||
if vg_name is not None:
|
||||
return [vg_name]
|
||||
return ['cinder-volumes', 'fake-vg-1']
|
||||
|
||||
def get_volumes(self):
|
||||
return ['fake-volume']
|
||||
|
||||
@ -44,9 +39,6 @@ class FakeBrickLVM(object):
|
||||
def get_physical_volumes(self):
|
||||
return []
|
||||
|
||||
def get_all_volume_groups(vg_name=None):
|
||||
return ['cinder-volumes', 'fake-vg']
|
||||
|
||||
def update_volume_group_info(self):
|
||||
pass
|
||||
|
||||
|
@ -393,12 +393,6 @@ def supports_thin_provisioning():
|
||||
utils.get_root_helper())
|
||||
|
||||
|
||||
def get_all_volumes(vg_name=None):
|
||||
return brick_lvm.LVM.get_all_volumes(
|
||||
utils.get_root_helper(),
|
||||
vg_name)
|
||||
|
||||
|
||||
def get_all_physical_volumes(vg_name=None):
|
||||
return brick_lvm.LVM.get_all_physical_volumes(
|
||||
utils.get_root_helper(),
|
||||
|
Loading…
Reference in New Issue
Block a user