Merge "Brick LVM: Rename get_all_volumes, further optimize"

This commit is contained in:
Jenkins 2014-10-30 15:56:34 +00:00 committed by Gerrit Code Review
commit 31d73fa9bc
3 changed files with 8 additions and 20 deletions

View File

@ -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,

View File

@ -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

View File

@ -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(),