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

Method execute

tests/ssh/base.py:125–131  ·  view source on GitHub ↗
(self, container, cmd, exit_code=0, **kwargs)

Source from the content-addressed store, hash-verified

123 return container
124
125 def execute(self, container, cmd, exit_code=0, **kwargs):
126 exc = self.client.exec_create(container, cmd, **kwargs)
127 output = self.client.exec_start(exc)
128 actual_exit_code = self.client.exec_inspect(exc)['ExitCode']
129 msg = "Expected `{}` to exit with code {} but returned {}:\n{}".format(
130 " ".join(cmd), exit_code, actual_exit_code, output)
131 assert actual_exit_code == exit_code, msg
132
133 def init_swarm(self, **kwargs):
134 return self._init_swarm(self.client, **kwargs)

Callers

nothing calls this directly

Calls 4

exec_createMethod · 0.80
exec_startMethod · 0.80
exec_inspectMethod · 0.80
joinMethod · 0.80

Tested by

no test coverage detected