Change in vdsm[master]: build on el6: import OrderedDict from elsewhere

danken at redhat.com danken at redhat.com
Tue Nov 13 12:30:12 UTC 2012


Dan Kenigsberg has uploaded a new change for review.

Change subject: build on el6: import OrderedDict from elsewhere
......................................................................

build on el6: import OrderedDict from elsewhere

Commit 1db772c71e has introduced usage of collections.OrderedDict which
is not part of el6's Python 2.6. This patch imports Raymond Hettinger's
implementation if OrderedDict is missing in the default location.

Change-Id: I92079c2639d892f283c771576ca25e333d0b1936
Signed-off-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm.spec.in
M vdsm_api/vdsmapi.py
2 files changed, 11 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/12/9212/1

diff --git a/vdsm.spec.in b/vdsm.spec.in
index d268948..88e3a1f 100644
--- a/vdsm.spec.in
+++ b/vdsm.spec.in
@@ -42,6 +42,9 @@
 BuildRequires: libvirt-python
 BuildRequires: sanlock-python >= 2.3
 BuildRequires: genisoimage
+%if 0%{?rhel}
+BuildRequires: python-ordereddict
+%endif
 
 # Autotools BuildRequires
 %if 0%{?enable_autotools}
@@ -162,6 +165,9 @@
 BuildArch:      noarch
 
 Requires: %{name}-python = %{version}-%{release}
+%if 0%{?rhel}
+Requires: python-ordereddict
+%endif
 
 %description jsonrpc
 A Json-based RPC interface that serves as the protocol for libvdsm.
diff --git a/vdsm_api/vdsmapi.py b/vdsm_api/vdsmapi.py
index a91b233..c68daa1 100644
--- a/vdsm_api/vdsmapi.py
+++ b/vdsm_api/vdsmapi.py
@@ -24,7 +24,11 @@
 # Refer to the README and COPYING files for full details of the license
 #
 
-from collections import OrderedDict
+try:
+    from collections import OrderedDict
+    OrderedDict  # make pyflakes happy
+except ImportError:
+    from ordereddict import OrderedDict
 
 
 def tokenize(data):


--
To view, visit http://gerrit.ovirt.org/9212
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I92079c2639d892f283c771576ca25e333d0b1936
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Dan Kenigsberg <danken at redhat.com>


More information about the vdsm-patches mailing list