Skip to content
This repository has been archived by the owner on Aug 3, 2020. It is now read-only.

Commit

Permalink
Merge pull request #209 from cjellick/revert-volume-delete
Browse files Browse the repository at this point in the history
Revert "Dont delete volumes when deleting container"
  • Loading branch information
Craig Jellick committed Jan 13, 2016
2 parents 6991369 + 0ce1a36 commit 7278b74
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
2 changes: 2 additions & 0 deletions cattle/agent/handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ def _get_handler_category(self, req):
class KindBasedMixin(object):
CHECK_PATHS = [
["imageStoragePoolMap", "storagePool", "kind"],
["volumeStoragePoolMap", "storagePool", "kind"],
["snapshotStoragePoolMap", "storagePool", "kind"],
["instanceHostMap", "host", "kind"],
["instanceForceStop", "kind"],
["instanceInspect", "kind"],
Expand Down
7 changes: 3 additions & 4 deletions cattle/plugins/docker/storage.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from contextlib import closing
from cattle.type_manager import get_type, MARSHALLER
from cattle.storage import BaseStoragePool
from cattle.agent.handler import KindBasedMixin
from cattle.plugins.docker.util import is_no_op, remove_container
from cattle.lock import lock
from cattle.progress import Progress
Expand All @@ -15,8 +16,9 @@
log = logging.getLogger('docker')


class DockerPool(BaseStoragePool):
class DockerPool(KindBasedMixin, BaseStoragePool):
def __init__(self):
KindBasedMixin.__init__(self, kind='docker')
BaseStoragePool.__init__(self)

@staticmethod
Expand Down Expand Up @@ -292,9 +294,6 @@ def volume_remove(self, req=None, volumeStoragePoolMap=None, **kw):
data = self._get_response_data(req, volumeStoragePoolMap)
return self._reply(req, data)

def _check_supports(self, req):
return True


class ImageValidationError(Exception):
pass
Expand Down
2 changes: 1 addition & 1 deletion cattle/plugins/docker/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def is_no_op(resource):

def remove_container(client, container):
try:
client.remove_container(container, force=True)
client.remove_container(container, force=True, v=True)
except APIError as e:
try:
if e.response.status_code != 404:
Expand Down

0 comments on commit 7278b74

Please sign in to comment.