summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Synacek <jsynacek@redhat.com>2014-03-03 14:19:21 +0100
committerJan Synacek <jsynacek@redhat.com>2014-03-07 10:19:08 +0100
commite460bf50714c93df195a5648a9943bca0041145f (patch)
tree9acc7efbd6fe958737145d6f49a0620691555d24
parentad3e2913fade67201df8fc03c43fa537e9502e21 (diff)
downloadopenlmi-scripts-e460bf50714c93df195a5648a9943bca0041145f.tar.gz
openlmi-scripts-e460bf50714c93df195a5648a9943bca0041145f.tar.xz
openlmi-scripts-e460bf50714c93df195a5648a9943bca0041145f.zip
storage: list thinly provisioned devices in provides/depends
-rw-r--r--commands/storage/lmi/scripts/storage/common.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/commands/storage/lmi/scripts/storage/common.py b/commands/storage/lmi/scripts/storage/common.py
index 57824cf..ea43e7f 100644
--- a/commands/storage/lmi/scripts/storage/common.py
+++ b/commands/storage/lmi/scripts/storage/common.py
@@ -354,6 +354,15 @@ def get_parents(ns, obj, deep=False):
yield parent
elif lmi_isinstance(obj, ns.CIM_StoragePool):
+ # find VGs of the thin pool
+ assoc_class = "LMI_VGAllocatedFromStoragePool"
+ if assoc_class in ns.classes():
+ parents = obj.associators(
+ AssocClass=assoc_class,
+ Role="Dependent")
+ for parent in parents:
+ yield parent
+
# find physical volumes of the VG
parents = obj.associators(
AssocClass="LMI_VGAssociatedComponentExtent",
@@ -438,6 +447,15 @@ def get_children(ns, obj, deep=False):
yield c
elif lmi_isinstance(obj, ns.CIM_StoragePool):
+ # find thin pools from the VG
+ assoc_class = "LMI_VGAllocatedFromStoragePool"
+ if assoc_class in ns.classes():
+ children = obj.associators(
+ AssocClass=assoc_class,
+ Role="Antecedent")
+ for child in children:
+ yield child
+
# find LVs allocated from the VG
children = obj.associators(
AssocClass="LMI_LVAllocatedFromStoragePool",