summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJenkins <jenkins@review.openstack.org>2017-03-13 09:37:46 +0000
committerGerrit Code Review <review@openstack.org>2017-03-13 09:37:46 +0000
commitab344cbc522de3b7eb9267531cc8978e9f76db0c (patch)
tree758873b01002232f6c4d301cbfbd7b5e9b6a643e
parentd7c6e90c8d487591e7aa1e1bd1b8b3316c89a6d2 (diff)
parent97201abd7856a5c835298e743f39ff61e03b6fe1 (diff)
Merge "Fix Glance API pagination polling"
-rw-r--r--deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_openstack.py19
1 files changed, 8 insertions, 11 deletions
diff --git a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_openstack.py b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_openstack.py
index 2da8670..2013b30 100644
--- a/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_openstack.py
+++ b/deployment_scripts/puppet/modules/lma_collector/files/collectd/collectd_openstack.py
@@ -351,21 +351,18 @@ class CollectdPlugin(base.Base):
351 351
352 _objects.extend(bulk_objs) 352 _objects.extend(bulk_objs)
353 353
354 links = resp.get('{}_links'.format(object_name)) 354 if self.pagination_limit is None:
355 if links is None or self.pagination_limit is None:
356 # Either the pagination is not supported or there is
357 # no more data
358 # In both cases, we got at this stage all the data we
359 # can have.
360 break 355 break
361 356
362 # if there is no 'next' link in the response, all data has 357 links = resp.get('{}_links'.format(object_name), [])
363 # been read. 358 has_next = len(
364 if len([i for i in links if i.get('rel') == 'next']) == 0: 359 [i for i in links if i.get('rel') == 'next']) > 0 or \
360 resp.get('next')
361 if has_next:
362 _opts['marker'] = bulk_objs[-1]['id']
363 else:
365 break 364 break
366 365
367 _opts['marker'] = bulk_objs[-1]['id']
368
369 if not has_failure: 366 if not has_failure:
370 self._last_run = last_run 367 self._last_run = last_run
371 368