MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / get_container_env_info

Function get_container_env_info

pymongo/pool_options.py:112–122  ·  view source on GitHub ↗

Returns the runtime and orchestrator of a container. If neither value is present, the metadata client.env.container field will be omitted.

()

Source from the content-addressed store, hash-verified

110
111
112def get_container_env_info() -> dict[str, str]:
113 """Returns the runtime and orchestrator of a container.
114 If neither value is present, the metadata client.env.container field will be omitted."""
115 container = {}
116
117 if Path(DOCKER_ENV_PATH).exists():
118 container["runtime"] = RUNTIME_NAME_DOCKER
119 if os.getenv(ENV_VAR_K8S):
120 container["orchestrator"] = ORCHESTRATOR_NAME_K8S
121
122 return container
123
124
125def _is_lambda() -> bool:

Callers 1

_metadata_envFunction · 0.85

Calls 1

existsMethod · 0.45

Tested by

no test coverage detected