[openlmi-scripts/epel7] support recent version of tools in rhel7

Michal Minar miminar at fedoraproject.org
Mon Dec 15 09:11:07 UTC 2014


commit 10e6ef5061da727b0fe3dbe350fdef715afd1bcb
Author: Michal Minar <miminar at redhat.com>
Date:   Mon Dec 15 10:07:43 2014 +0100

    support recent version of tools in rhel7
    
    Connection creation was broken because of differencies in property
    naming of older and newer LMIShell's LMIConnection.
    
    Set upper suported version of openlmi-tools. Higher version will ship
    with LMI metacommand - therefore openlmi-scripts will need to get rid of
    it.

 openlmi-scripts.spec                           |    9 ++++++++-
 openlmi-tools-0.10.4-support-older-shell.patch |   21 +++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletions(-)
---
diff --git a/openlmi-scripts.spec b/openlmi-scripts.spec
index 748f142..a1d16c5 100644
--- a/openlmi-scripts.spec
+++ b/openlmi-scripts.spec
@@ -8,7 +8,7 @@
 
 Name:           openlmi-scripts
 Version:        0.4.0
-Release:        2%{?dist}
+Release:        3%{?dist}
 Summary:        Client-side python modules and command line utilities
 
 License:        GPLv2+
@@ -22,6 +22,7 @@ Source2:        README-realmd.md
 Source3:        README-selinux.md
 BuildArch:      noarch
 Patch1:         openlmi-tools-0.10.4-python-egg-name.patch
+Patch2:         openlmi-tools-0.10.4-support-older-shell.patch
 
 BuildRequires:  python2-devel
 # For documentation
@@ -29,6 +30,7 @@ BuildRequires:  python-docopt
 BuildRequires:  python-sphinx
 BuildRequires:  python-sphinx-theme-openlmi
 BuildRequires:  openlmi-tools >= 0.9
+BuildRequires:  openlmi-tools  < 0.10.0
 BuildRequires:  python-IPy
 BuildRequires:  ImageMagick
 BuildRequires:  pyparsing
@@ -36,6 +38,7 @@ Requires:       python2
 Requires:       openlmi-python-base >= 0.5.0
 Requires:       python-docopt >= 0.6.1
 Requires:       openlmi-tools >= 0.9
+Requires:       openlmi-tools  < 0.10.0
 Requires:       pyparsing
 
 %description
@@ -182,6 +185,7 @@ system.
 %setup -cqn %{name} -a 1
 pushd openlmi-tools-%{tools_version}
 %patch1 -p1 -b .python_egg_name
+%patch2 -p1 -b .support-olders-shell
 popd
 
 find %{name}-%{commit}/commands/ -name '*.py.skel' | xargs sed -i \
@@ -366,6 +370,9 @@ install -m 0644 %{SOURCE3} %{buildroot}%{_docdir}/%{name}-selinux/README.md
 %{python2_sitelib}/openlmi_scripts_system-*
 
 %changelog
+* Mon Dec 15 2014 Michal Minar <miminar at redhat.com> 0.4.0-3
+- Proper support for recent openlmi-tools in rhel7.
+
 * Fri Dec 12 2014 Michal Minar <miminar at redhat.com> 0.4.0-2
 - Fixed egg requirements.
 
diff --git a/openlmi-tools-0.10.4-support-older-shell.patch b/openlmi-tools-0.10.4-support-older-shell.patch
new file mode 100644
index 0000000..5aaa855
--- /dev/null
+++ b/openlmi-tools-0.10.4-support-older-shell.patch
@@ -0,0 +1,21 @@
+Index: openlmi-tools-0.10.4/cli/lmi/scripts/common/session.py
+===================================================================
+--- openlmi-tools-0.10.4.orig/cli/lmi/scripts/common/session.py
++++ openlmi-tools-0.10.4/cli/lmi/scripts/common/session.py
+@@ -107,8 +107,14 @@ class Session(object):
+             kwargs['prompt_prefix'] = '[%s] ' % hostname
+         connection = connect(hostname, username, password, **kwargs)
+         if connection is not None:
+-            tp = connection.client._cliconn.creds
+-            if tp is None:
++            client = None
++            if hasattr(connection, "client"):
++                client = connection.client
++            elif hasattr(connection, "_client"):
++                client = connection._client
++            if client is not None:
++                tp = client._cliconn.creds
++            if client is None or tp is None:
+                 tp = ('', '')
+             self._credentials[hostname] = (tp[0], tp[1], True)
+         else:


More information about the scm-commits mailing list