diff options
author | Victor Stinner <vstinner@redhat.com> | 2015-05-15 18:16:21 +0200 |
---|---|---|
committer | Victor Stinner <vstinner@redhat.com> | 2015-05-15 22:41:52 +0200 |
commit | de9c4891e785d4ac487291a81b25790433c09112 (patch) | |
tree | 423ed06d4a6a5f9510212247338b329c9a2273ac /ceilometer/agent | |
parent | 253a6288e8bc1071da34ee02e3f53bbcbe8a75d6 (diff) | |
download | ceilometer-de9c4891e785d4ac487291a81b25790433c09112.tar.gz |
Python 3: generalize the usage of the six module
* Replace itertools.ifilter() with six.moves.filter()
* Replace itertools.imap() with six.moves.map()
* Replace map(_compare, statistics)
with [_compare(statistic) for statistic in statistics]
* Replace obj.iterkeys() with six.iterkeys(obj)
* Replace obj.iteritems() with six.iteritems(obj)
* Replace xrange() with six.moves.xrange(), or with range() for small
ranges
* Replace the repr module with six.moves.reprlib
Change-Id: Iaaa328cc15355182bde444a1aeaa4385691c8f90
Diffstat (limited to 'ceilometer/agent')
-rw-r--r-- | ceilometer/agent/base.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ceilometer/agent/base.py b/ceilometer/agent/base.py index 631c82f1..7c59657b 100644 --- a/ceilometer/agent/base.py +++ b/ceilometer/agent/base.py @@ -26,6 +26,7 @@ import random from oslo_config import cfg from oslo_context import context import six +from six import moves from six.moves.urllib import parse as urlparse from stevedore import extension @@ -214,7 +215,7 @@ class AgentManager(os_service.Service): extensions = (self._extensions('poll', namespace).extensions for namespace in namespaces) if pollster_list: - extensions = (itertools.ifilter(_match, exts) + extensions = (moves.filter(_match, exts) for exts in extensions) self.extensions = list(itertools.chain(*list(extensions))) |