File 0001-Use-ordereddict-compatibility-for-Python-2.6.patch of Package openstack-heat-cfntools

From 93df6fd666232ef1ce4daa3c292196c4201e4e36 Mon Sep 17 00:00:00 2001
From: Dirk Mueller <dirk@dmllr.de>
Date: Mon, 29 Apr 2013 20:10:47 +0200
Subject: [PATCH] Use ordereddict compatibility for Python 2.6

In Python 2.6, SafeConfigParser defaults to "dict", which
does no preserve section order, that the testsuite depends
on. Use the ordereddict drop-in

Change-Id: Ia4e14018ae70c465b0b56d406d29fbb3c2ea280c
---
 heat_cfntools/cfntools/cfn_helper.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/heat_cfntools/cfntools/cfn_helper.py b/heat_cfntools/cfntools/cfn_helper.py
index c2247ba..1ae5eaf 100644
--- a/heat_cfntools/cfntools/cfn_helper.py
+++ b/heat_cfntools/cfntools/cfn_helper.py
@@ -26,6 +26,7 @@ import hashlib
 import json
 import logging
 import os
+import sys
 import os.path
 import pwd
 try:
@@ -70,7 +71,12 @@ def parse_creds_file(path='/etc/cfn/cfn-credentials'):
 
 class HupConfig(object):
     def __init__(self, fp_list):
-        self.config = ConfigParser.SafeConfigParser()
+        if tuple(sys.version_info)[0:2] < (2, 7):
+            import ordereddict
+            self.config = ConfigParser.SafeConfigParser(None, ordereddict.OrderedDict)
+        else:
+            self.config = ConfigParser.SafeConfigParser()
+
         for fp in fp_list:
             self.config.readfp(fp)
 
-- 
1.8.1.4

openSUSE Build Service is sponsored by