diff options
author | Jan Synacek <jsynacek@redhat.com> | 2014-03-03 13:21:52 +0100 |
---|---|---|
committer | Jan Synacek <jsynacek@redhat.com> | 2014-03-07 10:18:27 +0100 |
commit | ad3e2913fade67201df8fc03c43fa537e9502e21 (patch) | |
tree | 25b1dd4f5f0117411eecba13164307ca8bb85f78 /commands/storage/lmi | |
parent | a4b523727df1cdba61fcd0a01c60a0359ef2c52f (diff) | |
download | openlmi-scripts-ad3e2913fade67201df8fc03c43fa537e9502e21.tar.gz openlmi-scripts-ad3e2913fade67201df8fc03c43fa537e9502e21.tar.xz openlmi-scripts-ad3e2913fade67201df8fc03c43fa537e9502e21.zip |
storage: list thinly provisioned devices in storage tree
Diffstat (limited to 'commands/storage/lmi')
-rw-r--r-- | commands/storage/lmi/scripts/storage/lvm.py | 9 | ||||
-rw-r--r-- | commands/storage/lmi/scripts/storage/storage_cmd.py | 10 |
2 files changed, 15 insertions, 4 deletions
diff --git a/commands/storage/lmi/scripts/storage/lvm.py b/commands/storage/lmi/scripts/storage/lvm.py index af76dcc..15db230 100644 --- a/commands/storage/lmi/scripts/storage/lvm.py +++ b/commands/storage/lmi/scripts/storage/lvm.py @@ -279,10 +279,11 @@ def get_tps(ns): :rtype: list of LMIInstance/LMI_VGStoragePool """ - LOG().debug("get_vgs: Loading list of all thin pools.") - for vg in ns.LMI_VGStoragePool.instances(): - if vg.SpaceLimitDetermination: - yield vg + if "LMI_VGAllocatedFromStoragePool" in ns.classes(): + LOG().debug("get_tps: Loading list of all thin pools.") + for vg in ns.LMI_VGStoragePool.instances(): + if vg.SpaceLimitDetermination: + yield vg def get_tp_vgs(ns, tp): """ diff --git a/commands/storage/lmi/scripts/storage/storage_cmd.py b/commands/storage/lmi/scripts/storage/storage_cmd.py index f8945cf..218b617 100644 --- a/commands/storage/lmi/scripts/storage/storage_cmd.py +++ b/commands/storage/lmi/scripts/storage/storage_cmd.py @@ -307,6 +307,8 @@ class Tree(command.LmiLister): # Add *all* LMI_VGStoragePools. for vg in lvm.get_vgs(ns): devices[self.get_obj_id(ns, vg)] = vg + for tp in lvm.get_tps(ns): + devices[self.get_obj_id(ns, tp)] = tp # deps = array of tuples (parent devid, child devid) # Load all dependencies, calling get_children iteratively is slow @@ -355,6 +357,14 @@ class Tree(command.LmiLister): self.get_obj_id(ns, i.GroupComponent)) for i in ns.LMI_VGAssociatedComponentExtent.instances()] + # Add VG-ThinPool dependencies from LMI_VGAllocatedFromStoragePool + if "LMI_VGAllocatedFromStoragePool" in ns.classes(): + LOG().debug("Loading VGAllocatedFromStoragePool associations.") + deps += [ + (self.get_obj_id(ns, i.Antecedent), + self.get_obj_id(ns, i.Dependent)) + for i in ns.LMI_VGAllocatedFromStoragePool.instances()] + # queue = array of tuples (devid, level), queue of items to inspect # and display queue = [] |