diff options
author | gordon chung <gord@live.ca> | 2014-10-28 18:26:45 +0000 |
---|---|---|
committer | gordon chung <gord@live.ca> | 2014-10-29 09:34:25 -0400 |
commit | c7d3b47ad05ba4cb29bb5f8042e150522e4a4ff5 (patch) | |
tree | 752d04c23ae2f352c8ea438c45bd7fcab9105741 /ceilometer/ipmi | |
parent | 89861616f2f25e65000baa5b8c28fe293266c02d (diff) | |
download | ceilometer-c7d3b47ad05ba4cb29bb5f8042e150522e4a4ff5.tar.gz |
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
Diffstat (limited to 'ceilometer/ipmi')
-rw-r--r-- | ceilometer/ipmi/platform/intel_node_manager.py | 20 |
1 files changed, 6 insertions, 14 deletions
diff --git a/ceilometer/ipmi/platform/intel_node_manager.py b/ceilometer/ipmi/platform/intel_node_manager.py index 9f4a46fa..f80e0cd7 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 |