From c7d3b47ad05ba4cb29bb5f8042e150522e4a4ff5 Mon Sep 17 00:00:00 2001 From: gordon chung Date: Tue, 28 Oct 2014 18:26:45 +0000 Subject: [PATCH] remove ordereddict requirement we don't support py26 in Kilo anymore. since OrderedDict is supported in py27+, we can remove this dependency. Change-Id: Iafe1cf4ab6de36f6be8ca84580b76cf2dc5b90a7 --- .../ipmi/platform/intel_node_manager.py | 20 ++++++------------- requirements.txt | 1 - 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/ceilometer/ipmi/platform/intel_node_manager.py b/ceilometer/ipmi/platform/intel_node_manager.py index 9f4a46fa9..f80e0cd74 100644 --- a/ceilometer/ipmi/platform/intel_node_manager.py +++ b/ceilometer/ipmi/platform/intel_node_manager.py @@ -25,6 +25,7 @@ system power and temperature data based on ipmitool. """ import binascii +import collections import tempfile import time @@ -34,23 +35,14 @@ from ceilometer.openstack.common.gettextutils import _ from oslo.config import cfg -def get_ordereddict(): - """A fix for py26 not having ordereddict.""" - try: - import collections - return collections.OrderedDict - except AttributeError: - import ordereddict - return ordereddict.OrderedDict - -OrderedDict = get_ordereddict() - OPTS = [ cfg.IntOpt('node_manager_init_retry', default=3, help='Number of retries upon Intel Node ' 'Manager initialization failure') ] + + CONF = cfg.CONF CONF.register_opts(OPTS, group='ipmi') @@ -73,7 +65,7 @@ INTEL_PREFIX = '5701000d01' ONE_RETURN_TEMPLATE = {"ret": 1} -BMC_INFO_TEMPLATE = OrderedDict() +BMC_INFO_TEMPLATE = collections.OrderedDict() BMC_INFO_TEMPLATE['Device_ID'] = 1 BMC_INFO_TEMPLATE['Device_Revision'] = 1 BMC_INFO_TEMPLATE['Firmware_Revision_1'] = 1 @@ -84,7 +76,7 @@ BMC_INFO_TEMPLATE['Manufacturer_ID'] = 3 BMC_INFO_TEMPLATE['Product_ID'] = 2 BMC_INFO_TEMPLATE['Auxiliary_Firmware_Revision'] = 4 -NM_STATISTICS_TEMPLATE = OrderedDict() +NM_STATISTICS_TEMPLATE = collections.OrderedDict() NM_STATISTICS_TEMPLATE['Manufacturer_ID'] = 3 NM_STATISTICS_TEMPLATE['Current_value'] = 2 NM_STATISTICS_TEMPLATE['Minimum_value'] = 2 @@ -94,7 +86,7 @@ NM_STATISTICS_TEMPLATE['Time_stamp'] = 4 NM_STATISTICS_TEMPLATE['Report_period'] = 4 NM_STATISTICS_TEMPLATE["DomainID_PolicyState"] = 1 -NM_GET_DEVICE_ID_TEMPLATE = OrderedDict() +NM_GET_DEVICE_ID_TEMPLATE = collections.OrderedDict() NM_GET_DEVICE_ID_TEMPLATE['Device_ID'] = 1 NM_GET_DEVICE_ID_TEMPLATE['Device_revision'] = 1 NM_GET_DEVICE_ID_TEMPLATE['Firmware_revision_1'] = 1 diff --git a/requirements.txt b/requirements.txt index 557208c3a..7fc40a4f3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -17,7 +17,6 @@ lockfile>=0.8 lxml>=2.3 msgpack-python>=0.4.0 netaddr>=0.7.12 -ordereddict oslo.db>=1.0.0 # Apache-2.0 oslo.config>=1.4.0 # Apache-2.0 oslo.rootwrap>=1.3.0