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

Method set_current_context

docker/context/api.py:136–144  ·  view source on GitHub ↗
(cls, name="default")

Source from the content-addressed store, hash-verified

134
135 @classmethod
136 def set_current_context(cls, name="default"):
137 ctx = cls.get_context(name)
138 if not ctx:
139 raise errors.ContextNotFound(name)
140
141 err = write_context_name_to_docker_config(name)
142 if err:
143 raise errors.ContextException(
144 f'Failed to set current context: {err}')
145
146 @classmethod
147 def remove_context(cls, name):

Callers

nothing calls this directly

Calls 2

get_contextMethod · 0.80

Tested by

no test coverage detected