wvandeun / nornir_netbox

NetBox plugin for Nornir
Apache License 2.0
69 stars 17 forks source link

Connection aborted #49

Closed gbs098 closed 1 year ago

gbs098 commented 1 year ago

Hello, how can ignore proxy? Have tried like what but dosen't work

inventory:
  plugin: NetBoxInventory2
  options:
    nb_url: "https://nb_test/"
    nb_token: "*****"
    ssl_verify: False
    proxies:
      http: ""
      https: ""
gbs098 commented 1 year ago

Find solution, no need more help can close ticket Thx

# ignore proxy
os.environ["no_proxy"] = "*"
wvandeun commented 1 year ago

The plugin itself does not have an explicit option to configure http proxies. However the underlying library we use, requests, configures its usage of proxies through environment variables, as it is documented here https://docs.python-requests.org/en/latest/user/advanced/?highlight=proxy#proxies

Unsetting these variables in the shell, or through os.environ will force the requests library to connect directly.