Hello Lee Yarwood,

I'd like you to do a code review.  Please visit

    http://gerrit.ovirt.org/20779

to review the following change.

Change subject: Use max=1000 option return results when calling the oVirt API.
......................................................................

Use max=1000 option 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 leads to incomplete LCs being collected.

This change introduces the max=1000 option to each .list() call to allow
a greater number of results to be returned.
(cherry picked from b1b4b2a79ba91239dfa7e1ba1fb49f5e83321f5a)

Change-Id: I0c9f61938df1626b1d81e4c0320b5bca10614f34
Bug-Url: https://bugzilla.redhat.com/1025409
Signed-off-by: Lee Yarwood <[email protected]>
Signed-off-by: Sandro Bonazzola <[email protected]>
---
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/79/20779/1

diff --git a/.gitignore b/.gitignore
index 214d223..ac3a67d 100644
--- a/.gitignore
+++ b/.gitignore
@@ -23,3 +23,4 @@
 src/config.py.in
 src/logrotate.d/ovirt-log-collector
 ovirt-log-collector-*.tar.gz
+.idea
diff --git a/src/helper/hypervisors.py b/src/helper/hypervisors.py
index 9addaf7..3faeb32 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/20779
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: ovirt-log-collector-3.2
Gerrit-Owner: Sandro Bonazzola <[email protected]>
Gerrit-Reviewer: Lee Yarwood <[email protected]>
_______________________________________________
Engine-patches mailing list
[email protected]
http://lists.ovirt.org/mailman/listinfo/engine-patches

Reply via email to