MCPcopy Index your code
hub / github.com/docker/docker-py / inject_proxy_environment

Method inject_proxy_environment

docker/utils/proxy.py:56–69  ·  view source on GitHub ↗

Given a list of strings representing environment variables, prepend the environment variables corresponding to the proxy settings.

(self, environment)

Source from the content-addressed store, hash-verified

54 return env
55
56 def inject_proxy_environment(self, environment):
57 '''
58 Given a list of strings representing environment variables, prepend the
59 environment variables corresponding to the proxy settings.
60 '''
61 if not self:
62 return environment
63
64 proxy_env = format_environment(self.get_environment())
65 if not environment:
66 return proxy_env
67 # It is important to prepend our variables, because we want the
68 # variables defined in "environment" to take precedence.
69 return proxy_env + environment
70
71 def __str__(self):
72 return (

Callers 2

create_containerMethod · 0.80

Calls 2

get_environmentMethod · 0.95
format_environmentFunction · 0.85

Tested by 1