home-assistant-ecosystem / python-glances-api

Python API for interacting with Glances
MIT License
4 stars 8 forks source link

Support disabling SSL verification #4

Closed GuyKh closed 2 years ago

GuyKh commented 2 years ago

The test needs an update.

Not sure why - since it has a default value - why would that make a difference?

fabaff commented 2 years ago

Not sure why - since it has a default value - why would that make a difference?

The test and the example are failing as verifiy is implemented in the wrong way.

[...]
  File "/home/fab/Documents/repos/python-glances-api/example.py", line 15, in main
    await data.get_metrics("mem")
  File "/home/fab/Documents/repos/python-glances-api/glances_api/__init__.py", line 71, in get_metrics
    await self.get_data("all")
  File "/home/fab/Documents/repos/python-glances-api/glances_api/__init__.py", line 43, in get_data
    response = await client.get(str(url), verify=self.verify_ssl)
TypeError: AsyncClient.get() got an unexpected keyword argument 'verify'

See https://www.python-httpx.org/advanced/#ssl-configuration-on-client-instances