Commit c0e582b9 authored by Daniele Venzano's avatar Daniele Venzano
Browse files

Print a warning instead of raising an exception when failing to remove a workspace

parent c5e63c92
...@@ -15,10 +15,13 @@ ...@@ -15,10 +15,13 @@
import os.path import os.path
import shutil import shutil
import logging
import zoe_master.workspace.base import zoe_master.workspace.base
import zoe_master.config as config import zoe_master.config as config
log = logging.getLogger(__name__)
class ZoeFSWorkspace(zoe_master.workspace.base.ZoeWorkspaceBase): class ZoeFSWorkspace(zoe_master.workspace.base.ZoeWorkspaceBase):
def __init__(self): def __init__(self):
...@@ -30,7 +33,10 @@ class ZoeFSWorkspace(zoe_master.workspace.base.ZoeWorkspaceBase): ...@@ -30,7 +33,10 @@ class ZoeFSWorkspace(zoe_master.workspace.base.ZoeWorkspaceBase):
def destroy(self, user): def destroy(self, user):
path = os.path.join(self.base_path, user.name) path = os.path.join(self.base_path, user.name)
shutil.rmtree(path) try:
shutil.rmtree(path)
except OSError:
log.warning("Cannot remove workspace directory %s" % path)
def exists(self, user): def exists(self, user):
return os.path.exists(os.path.join(self.base_path, user.name)) return os.path.exists(os.path.join(self.base_path, user.name))
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment