Skip to content

Commit

Permalink
Respect HTTPS_PROXY variable. (#12)
Browse files Browse the repository at this point in the history
  • Loading branch information
Gerrit91 authored Oct 20, 2020
1 parent ec4e6ac commit da6aec7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions metal_python/driver.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import hmac
import random
import wrapt
import os

from abc import ABC
from hashlib import sha256
Expand All @@ -18,6 +19,9 @@ def __init__(self, url, bearer, hmac_key, hmac_user="Metal-Admin"):
self.config = Configuration()
self.config.host = url

if os.environ.get("HTTPS_PROXY"):
self.config.proxy = os.environ.get("HTTPS_PROXY")

if bearer:
self.config.api_key["Authorization"] = bearer
self.config.api_key_prefix["Authorization"] = "Bearer"
Expand Down

0 comments on commit da6aec7

Please sign in to comment.