[openlmi-tools] fix passing LMIInstance objects to method calls
Peter Hatina
phatina at fedoraproject.org
Wed Nov 6 13:42:24 UTC 2013
commit fc8de3540484e55acd40a523c7404a87e481ce95
Author: Peter Hatina <phatina at redhat.com>
Date: Wed Nov 6 14:27:13 2013 +0100
fix passing LMIInstance objects to method calls
...s-02-fix-passing-instances-to-method-call.patch | 13 +++++++++++++
openlmi-tools.spec | 7 ++++++-
2 files changed, 19 insertions(+), 1 deletions(-)
---
diff --git a/openlmi-tools-02-fix-passing-instances-to-method-call.patch b/openlmi-tools-02-fix-passing-instances-to-method-call.patch
new file mode 100644
index 0000000..1326565
--- /dev/null
+++ b/openlmi-tools-02-fix-passing-instances-to-method-call.patch
@@ -0,0 +1,13 @@
+diff --git a/cli/lmi/shell/LMIMethod.py b/cli/lmi/shell/LMIMethod.py
+index 5681b2f..a658e8c 100644
+--- a/cli/lmi/shell/LMIMethod.py
++++ b/cli/lmi/shell/LMIMethod.py
+@@ -478,6 +478,8 @@ class LMIMethod(LMIWrapperBaseObject):
+ if param in self._method.parameters:
+ if isinstance(value, LMIObjectFactory().LMIInstanceName):
+ value = value.wrapped_object
++ elif isinstance(value, LMIObjectFactory().LMIInstance):
++ value = value.wrapped_object.path
+ t = self._method.parameters[param].type
+ method_args[param] = lmi_cast_to_cim(t, value)
+ else:
diff --git a/openlmi-tools.spec b/openlmi-tools.spec
index 0ccdd01..c770ef4 100644
--- a/openlmi-tools.spec
+++ b/openlmi-tools.spec
@@ -1,12 +1,13 @@
Name: openlmi-tools
Version: 0.9
-Release: 2%{?dist}
+Release: 3%{?dist}
Summary: Set of CLI tools for Openlmi providers
License: GPLv2+
URL: http://fedorahosted.org/openlmi
Source0: http://fedorahosted.org/released/openlmi-tools/%{name}-%{version}.tar.gz
Patch0: openlmi-tools-01-fix-instance-deletion.patch
+Patch1: openlmi-tools-02-fix-passing-instances-to-method-call.patch
BuildArch: noarch
BuildRequires: automake
@@ -35,6 +36,7 @@ Summary: Documentation for %{name}
%prep
%setup -q
%patch0 -p1
+%patch1 -p1
%build
pushd cli
@@ -86,6 +88,9 @@ install -m 644 cli/completion/_lmishell $zsh_comp_dir
%{_docdir}/%{name}-%{version}/html
%changelog
+* Wed Nov 6 2013 Peter Hatina <phatina at redhat.com> - 0.9-3
+- fix passing instance references to method call
+
* Wed Nov 6 2013 Peter Hatina <phatina at redhat.com> - 0.9-2
- fix instance deletion
More information about the scm-commits
mailing list