Skip to content

Instantly share code, notes, and snippets.

@smothiki
Last active August 29, 2015 14:21
Show Gist options
  • Save smothiki/f440b575f48122268656 to your computer and use it in GitHub Desktop.
Save smothiki/f440b575f48122268656 to your computer and use it in GitHub Desktop.
def stop(self, name):
"""
Stop a container
"""
try:
self.docker_cli.stop(name)
except:
raise errors.DockerException("cannot stop container " + name)
def destroy(self, name):
"""
Destroy a container
"""
self.stop(name)
try:
self.docker_cli.remove_container(name)
except:
raise errors.DockerException("container " + name + " doesn't exist")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment