[openlmi-storage] Fix CreateOrModifyStoragePool exception. Resolves:#1054144
jsynacek
jsynacek at fedoraproject.org
Wed Jan 22 08:54:01 UTC 2014
commit d64422c1b026fda212bfd0cbb8152f48155f5c87
Author: Jan Synacek <jsynacek at redhat.com>
Date: Wed Jan 22 09:30:05 2014 +0100
Fix CreateOrModifyStoragePool exception.
Resolves:#1054144
...lmi-storage-0.7.1-strings-to-object-paths.patch | 44 ++++++++++++++++++++
openlmi-storage.spec | 9 ++++-
2 files changed, 52 insertions(+), 1 deletions(-)
---
diff --git a/openlmi-storage-0.7.1-strings-to-object-paths.patch b/openlmi-storage-0.7.1-strings-to-object-paths.patch
new file mode 100644
index 0000000..81f3280
--- /dev/null
+++ b/openlmi-storage-0.7.1-strings-to-object-paths.patch
@@ -0,0 +1,44 @@
+a056e11e52faa8dd879cc42771a196337a09852a
+Author: Jan Synacek <jsynacek at redhat.com>
+Date: Fri Jan 17 10:41:21 2014 +0100
+
+ Convert strings to object paths.
+
+ CreateOrModifyStoragePool() requires its InExtents argument be specified
+ as an array of strings. The strings should be properly converted into
+ CIMInstanceName objects.
+
+diff --git a/src/lmi/storage/LMI_StorageConfigurationService.py b/src/lmi/storage/LMI_StorageConfigurationService.py
+index bdd3851..13aa06b 100644
+--- a/src/lmi/storage/LMI_StorageConfigurationService.py
++++ b/src/lmi/storage/LMI_StorageConfigurationService.py
+@@ -38,4 +38,5 @@ from lmi.storage.SettingProvider import SettingProvider
+ from lmi.providers.JobManager import Job
+ import time
++import re
+
+ LOG = cmpi_logging.get_logger(__name__)
+@@ -602,4 +603,15 @@ class LMI_StorageConfigurationService(ServiceProvider):
+ Raise CIMError, if any of the extents cannot be found.
+ """
++
++ def string_to_instance_name(string):
++ m = re.search('(?://([^:.,]+)/)?([^:.,]+/[^:.,]+):(\w+)\.', string)
++ (host, namespace, classname) = m.groups()
++ kb = re.findall(r'(\w+)="(.*?)(?<!\\)"', string)
++
++ return pywbem.CIMInstanceName(classname=classname,
++ namespace=namespace,
++ keybindings=kb,
++ host=host)
++
+ if not param_inextents:
+ return ([], [])
+@@ -607,4 +619,7 @@ class LMI_StorageConfigurationService(ServiceProvider):
+ redundancies = []
+ for extent_name in param_inextents:
++ if isinstance(extent_name, str):
++ extent_name = string_to_instance_name(extent_name)
++
+ provider = self.provider_manager.get_device_provider_for_name(
+ extent_name)
diff --git a/openlmi-storage.spec b/openlmi-storage.spec
index 7eab6c9..2755919 100644
--- a/openlmi-storage.spec
+++ b/openlmi-storage.spec
@@ -2,7 +2,7 @@
Name: openlmi-storage
Version: 0.7.1
-Release: 1%{?dist}
+Release: 2%{?dist}
Summary: CIM providers for storage management
License: LGPLv2+
@@ -27,6 +27,9 @@ Requires: openlmi-logicalfile
# For filesystems:
Requires: xfsprogs, btrfs-progs, e2fsprogs, dosfstools
+# https://bugzilla.redhat.com/show_bug.cgi?id=1054144
+Patch0: openlmi-storage-0.7.1-strings-to-object-paths.patch
+
%description
The openlmi-storage package contains CMPI providers for management of storage
using Common Information Managemen (CIM) protocol.
@@ -45,6 +48,7 @@ Summary: Documentation for %{name}
%prep
%setup -q
+%patch0 -p1
%build
%{__python} setup.py build
@@ -147,6 +151,9 @@ fi >> %logfile 2>&1
%{_docdir}/%{name}/admin_guide
%changelog
+* Wed Jan 22 2014 Jan Synáček <jsynacek at redhat.com> - 0.7.1-2
+- Fix CreateOrModifyStoragePool exception (#1054144).
+
* Wed Jan 8 2014 Jan Safranek <jsafrane at redhat.com> - 0.7.1-1
- New upstream release.
More information about the scm-commits
mailing list