Commit 7666c882 authored by Daniele Venzano's avatar Daniele Venzano

Add an option to specify a workspace path that is different from the deployment name

parent 1a28c6ed
......@@ -65,6 +65,7 @@ def load_configuration(test_conf=None):
argparser.add_argument('--influxdb-enable', action="store_true", help='Enable metric output toward influxDB')
argparser.add_argument('--gelf-address', help='Enable Docker GELF log output to this destination (ex. udp://1.2.3.4:1234)', default='')
argparser.add_argument('--workspace-base-path', help='Path where user workspaces will be created by Zoe. Must be visible at this path on all Swarm hosts.', default='/mnt/zoe-workspaces')
argparser.add_argument('--workspace-deployment-path', help='Path appended to the workspace path to distinguish this deployment. If unspecified is equal to the deployment name.', default='--default--')
argparser.add_argument('--overlay-network-name', help='Name of the Swarm overlay network Zoe should use', default='zoe')
# API options
......@@ -87,6 +88,9 @@ def load_configuration(test_conf=None):
if opts.debug:
argparser.print_values()
if opts.workspace_deployment_path == '--default--':
opts.workspace_deployment_path = opts.deployment_name
_CONF = opts
else:
_CONF = test_conf
......@@ -27,7 +27,7 @@ log = logging.getLogger(__name__)
class ZoeFSWorkspace(zoe_master.workspace.base.ZoeWorkspaceBase):
"""Filesystem workspace class."""
def __init__(self):
self.base_path = os.path.join(config.get_conf().workspace_base_path, config.get_conf().deployment_name)
self.base_path = os.path.join(config.get_conf().workspace_base_path, config.get_conf().workspace_deployment_path)
def exists(self, user_id):
"""Check if the workspace for user_id exists."""
......
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