From 2ba5d20cb07270eed111ae9ea3af978916369680 Mon Sep 17 00:00:00 2001 From: polyedre Date: Mon, 9 Aug 2021 11:39:56 +0200 Subject: [PATCH] Fetch all OS by looping over pages Previously, only the first page was fetched. --- cbw_api_toolbox/cbw_api.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cbw_api_toolbox/cbw_api.py b/cbw_api_toolbox/cbw_api.py index 8204593..be077df 100644 --- a/cbw_api_toolbox/cbw_api.py +++ b/cbw_api_toolbox/cbw_api.py @@ -789,11 +789,8 @@ def upload_compliance_airgapped_results(self, content): def operating_systems(self): """GET request to /api/v3/os to list all the operating systems""" - response = self._request("GET", [ROUTE_OS]) - if response.status_code != 200: - logging.error("Error::{}".format(response.text)) - return None - return self._cbw_parser(response) + response = self._get_pages("GET", [ROUTE_OS], params=None) + return response def server_reboot(self, server_id, params=None): """POST request to /api/v3/vulnerabilities/servers//reboot to reboot a server"""