Lee Yarwood has uploaded a new change for review.

Change subject: Use the max option to increase return results when calling the 
oVirt API.
......................................................................

Use the max option to increase return results when calling the oVirt API.

When calling the API the LC does not provide a max value, limiting
the results to 100 by default. For environments with 100+ DCs,
Clusters or hosts this results in incomplete LCs being collected.

This change introduces the max option to each .list() call to allow
up to 1000 results to be returned.

Change-Id: I0c9f61938df1626b1d81e4c0320b5bca10614f34
Bug-Url: https://bugzilla.redhat.com/1014379
Signed-off-by: Lee Yarwood <lyarw...@redhat.com>
---
M .gitignore
M src/helper/hypervisors.py
2 files changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/ovirt-log-collector 
refs/changes/59/19759/1

diff --git a/.gitignore b/.gitignore
index 095540c..9dbc273 100644
--- a/.gitignore
+++ b/.gitignore
@@ -21,3 +21,4 @@
 src/config.py
 src/config.py.in
 ovirt-log-collector-*.tar.gz
+.idea
diff --git a/src/helper/hypervisors.py b/src/helper/hypervisors.py
index b5e43e8..352dde2 100644
--- a/src/helper/hypervisors.py
+++ b/src/helper/hypervisors.py
@@ -152,11 +152,11 @@
     try:
         api = _initialize_api(hostname, username, password, ca, insecure)
         if api is not None:
-            for dc in api.datacenters.list():
+            for dc in api.datacenters.list(max=1000):
                 tree.add_datacenter(dc)
-            for cluster in api.clusters.list():
+            for cluster in api.clusters.list(max=1000):
                 tree.add_cluster(cluster)
-            for host in api.hosts.list():
+            for host in api.hosts.list(max=1000):
                 tree.add_host(host)
             result = set(tree.get_sortable())
     except RequestError as re:


-- 
To view, visit http://gerrit.ovirt.org/19759
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c9f61938df1626b1d81e4c0320b5bca10614f34
Gerrit-PatchSet: 1
Gerrit-Project: ovirt-log-collector
Gerrit-Branch: master
Gerrit-Owner: Lee Yarwood <lyarw...@redhat.com>
_______________________________________________
Engine-patches mailing list
Engine-patches@ovirt.org
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to