summaryrefslogtreecommitdiffstats
path: root/plugins.d
diff options
context:
space:
mode:
authorIlya <ilyamaschenko@gmail.com>2017-02-18 14:52:39 +0900
committerIlya <ilyamaschenko@gmail.com>2017-02-18 14:52:39 +0900
commit33bdf00775ccafd6de5f208c74c78104e9fd7859 (patch)
tree1cdfb8ec9051164bc122c9e9d5d37cbb209763a4 /plugins.d
parentbafbfe859ba0041689e4bcc33bcf2624afb26ced (diff)
python.d.plugin: OrderedDict import for python2.6 added
Diffstat (limited to 'plugins.d')
-rwxr-xr-xplugins.d/python.d.plugin14
1 files changed, 10 insertions, 4 deletions
diff --git a/plugins.d/python.d.plugin b/plugins.d/python.d.plugin
index 126041ab13..4fdfae3472 100755
--- a/plugins.d/python.d.plugin
+++ b/plugins.d/python.d.plugin
@@ -73,10 +73,16 @@ try:
DICT = OrderedDict
msg.info('YAML output is ordered')
except ImportError:
- ORDERED = False
- DICT = dict
- msg.info('YAML output is unordered')
-else:
+ try:
+ from ordereddict import OrderedDict
+ ORDERED = True
+ DICT = OrderedDict
+ msg.info('YAML output is ordered')
+ except ImportError:
+ ORDERED = False
+ DICT = dict
+ msg.info('YAML output is unordered')
+if ORDERED:
def ordered_load(stream, Loader=yaml.Loader, object_pairs_hook=OrderedDict):
class OrderedLoader(Loader):
pass