[openlmi-scripts] few bug fixes and documentation update

Michal Minar miminar at fedoraproject.org
Wed Feb 26 13:43:59 UTC 2014


commit 07cac10bd32c94e0c7270cf02463c7da6d2a9b85
Author: Michal Minar <miminar at redhat.com>
Date:   Wed Feb 26 14:43:05 2014 +0100

    few bug fixes and documentation update
    
    Resolves trac tickets #276 and #277

 openlmi-scripts-0.2.7-doc_built-ins.patch         |   35 +++++++++++++++++++++
 openlmi-scripts-0.2.7-storage_thinlv_checks.patch |   32 +++++++++++++++++++
 openlmi-scripts.spec                              |    6 +++
 3 files changed, 73 insertions(+), 0 deletions(-)
---
diff --git a/openlmi-scripts-0.2.7-doc_built-ins.patch b/openlmi-scripts-0.2.7-doc_built-ins.patch
new file mode 100644
index 0000000..9604a18
--- /dev/null
+++ b/openlmi-scripts-0.2.7-doc_built-ins.patch
@@ -0,0 +1,35 @@
+diff --git a/doc/usage.rst b/doc/usage.rst
+index 58c5a5d..70e19ca 100644
+--- a/doc/usage.rst
++++ b/doc/usage.rst
+@@ -104,4 +104,30 @@ Static commands
+     |      | argument.                                                        |
+     +------+------------------------------------------------------------------+
+ 
++Changing command namespaces
++---------------------------
++Changing or nesting to some command namespace can be achieved with built-in
++commands ``:cd`` and ``:..``. The latter is just a shortcut for ``:cd ..`` that
++changes to parent namespace. ``:cd`` accepts a path to command. Whole command
++path begins with ``/lmi`` prefix which denotes top-level command. Path
++beginning with a ``'/'`` is an absolute path, which means it contains all
++command names on a path from top-level command to target one. Other paths are
++relative to current command.
++
++Here is a an example of changing command namespaces: ::
++
++    lmi> :pwd
++    /lmi
++    lmi> :cd storage
++    >storage> :pwd
++    /lmi/storage
++    >storage> :cd lv
++    >>lv> :pwd
++    /lmi/storage/lv
++    >>lv> :cd ../raid
++    >>raid> :cd ../../sw/repo
++    >>repo> :..
++    >sw> :cd /storage       # /lmi prefix is optional for absolute paths
++    >storage :cd /
++    lmi>
+ 
diff --git a/openlmi-scripts-0.2.7-storage_thinlv_checks.patch b/openlmi-scripts-0.2.7-storage_thinlv_checks.patch
new file mode 100644
index 0000000..77bc0e0
--- /dev/null
+++ b/openlmi-scripts-0.2.7-storage_thinlv_checks.patch
@@ -0,0 +1,32 @@
+diff --git a/commands/storage/lmi/scripts/storage/lvm.py b/commands/storage/lmi/scripts/storage/lvm.py
+index 6c0a464..af76dcc 100644
+--- a/commands/storage/lmi/scripts/storage/lvm.py
++++ b/commands/storage/lmi/scripts/storage/lvm.py
+@@ -59,7 +59,11 @@ def get_lvs(ns, vgs=None):
+     else:
+         # No vgs supplied, list all LVs
+         for lv in ns.LMI_LVStorageExtent.instances():
+-            if not lv.ThinlyProvisioned:
++            # XXX workaround for https://fedorahosted.org/openlmi/ticket/277
++            supports_thin = 'ThinlyProvisioned' in lv.properties()
++            if not supports_thin:
++                yield lv
++            elif supports_thin and not lv.ThinlyProvisioned:
+                 yield lv
+ 
+ def get_tlvs(ns, tps=None):
+@@ -261,8 +265,13 @@ def get_vg_tps(ns, vg):
+     :param vg: Volume Group to examine.
+     :rtype: list of LMIInstance/CIM_StoragePool
+     """
++    # XXX workaround for https://fedorahosted.org/openlmi/ticket/276
++    assoc_class = "LMI_VGAllocatedFromStoragePool"
++    if not assoc_class in ns.classes():
++        return []
++
+     vg = common.str2vg(ns, vg)
+-    return vg.associators(AssocClass="LMI_VGAllocatedFromStoragePool")
++    return vg.associators(AssocClass=assoc_class)
+ 
+ def get_tps(ns):
+     """
diff --git a/openlmi-scripts.spec b/openlmi-scripts.spec
index f70035b..29df955 100644
--- a/openlmi-scripts.spec
+++ b/openlmi-scripts.spec
@@ -30,6 +30,8 @@ Requires:       openlmi-tools >= 0.9
 Patch0:         openlmi-scripts-0.2.7-hardware_support_older_providers.patch
 Patch1:         openlmi-scripts-0.2.7-storage_mount_fix.patch
 Patch2:         openlmi-scripts-0.2.7-service_error_handling.patch
+Patch3:         openlmi-scripts-0.2.7-doc_built-ins.patch
+Patch4:         openlmi-scripts-0.2.7-storage_thinlv_checks.patch
 
 %description
 Client-side python modules and command line utilities.
@@ -129,6 +131,8 @@ provider and command line wrapper.
 %patch0 -p1 -b .hardware_support_older_providers
 %patch1 -p1 -b .storage_mount_fix
 %patch2 -p1 -b .service_error_handling
+%patch3 -p1 -b .doc_built-ins
+%patch4 -p1 -b .storage_thinlv_checks
 
 %build
 %{__python} setup.py build
@@ -243,6 +247,8 @@ install -m 644 README.md COPYING Changelog $RPM_BUILD_ROOT/%{_docdir}/%{name}
 %changelog
 * Wed Feb 26 2014 Michal Minar <miminar at redhat.com> 0.2.7-5
 - Fixed error handling in service scripts.
+- Updated documentation for built-ins commands.
+- Fixed checking for thinlv provisioning in storage scripts.
 
 * Tue Feb 25 2014 Michal Minar <miminar at redhat.com> 0.2.7-4
 - Removed unstable features from hardware scripts.


More information about the scm-commits mailing list