ionos-cloud / sdk-python

Apache License 2.0
2 stars 3 forks source link

bug: `IONOS_HTTP_PROXY_HEADERS` without function #15

Open hegerdes opened 1 year ago

hegerdes commented 1 year ago

Description

The function to set http proxy headers via the environment variable IONOS_HTTP_PROXY_HEADERS is without any function.

Expected behavior

The set env gets used, parsed and sent to the proxy.

Environment

Red Hat Enterprise Linux 8.8

Python Version:

Python 3.9.16

SDK version:

ionoscloud 6.1.7

OS:

Linux

Configuration Files

None

How to Reproduce

export IONOS_HTTP_PROXY_HEADERS="Connection: Keep-Alive"
python my-script 
#or
ansible-playbook my-ionos-playbook

Error and Debug Output

"failed to set Server state present: 'str' object has no attribute 'items'"

Additional Notes

You source the env as a raw string here: https://github.com/ionos-cloud/sdk-python/blob/79cbd97ec3c1985964f6c790185ed86ffe715d10/ionoscloud/configuration.py#L222

But it never gets checked or parsed.

Later it gets passed directly to urllib3s ´ProxyManager´: https://github.com/ionos-cloud/sdk-python/blob/79cbd97ec3c1985964f6c790185ed86ffe715d10/ionoscloud/rest.py#L126

But ProxyManager expects a Dictionary (Mapping). See here

References