Skip to content

Commit

Permalink
Fetch all OS by looping over pages
Browse files Browse the repository at this point in the history
Previously, only the first page was fetched.
  • Loading branch information
polyedre authored and hezanathos committed Aug 10, 2021
1 parent 61d972f commit 2ba5d20
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions cbw_api_toolbox/cbw_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/<id>/reboot to reboot a server"""
Expand Down

0 comments on commit 2ba5d20

Please sign in to comment.