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 /tools | |
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 'tools')
-rw-r--r-- | tools/send_test_data.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tools/send_test_data.py b/tools/send_test_data.py index 09356b63..62484dec 100644 --- a/tools/send_test_data.py +++ b/tools/send_test_data.py @@ -27,6 +27,7 @@ import uuid import make_test_data from oslo_context import context +from six import moves from ceilometer import messaging from ceilometer import service @@ -53,7 +54,7 @@ def generate_data(rpc_client, make_data_args, samples_count, make_data_args.resource_id = None resources_list = [str(uuid.uuid4()) - for _ in xrange(resources_count)] + for _ in moves.xrange(resources_count)] resource_samples = {resource: 0 for resource in resources_list} batch = [] count = 0 |