...
 
......@@ -1610,15 +1610,16 @@ class ContainerDocker(Container):
def mount_paths(self, mountlist):
"""Given a list of paths, mount them in the container. Called by maxwell_service when receiving the command mount_paths.
This functionality is needed for the MyGeohub hydroshare connectivity via /srv/irods/external.
Docker implementation: store the information on the mount points until we can start the container."""
Docker implementation: store the information on the mount points until we can start the container.
This container instance is preserved during the call to maxwell_service, which received all
the information it needed with the "startxapp" command."""
for mount_pt in mountlist:
log("mounting %s" % (mount_pt))
log("registering mount point %s" % (mount_pt))
# mount_pt must already exist
if not os.path.exists(mount_pt):
log("trying to mount '%s' but it doesn't exist" % mount_pt)
continue
self.mounts += [mount_pt, 'rw,noatime']
self.mounts += [[mount_pt, 'rw,noatime']]
def groups(self):
""" find last user in /etc/passwd, and get the groups"""
......@@ -1681,7 +1682,7 @@ class ContainerDocker(Container):
def __root_mount(self, point, perm):
"""Build list of mount points to use when creating container. "perm" is intended to be
used as is in the mount command option '-o' """
self.mounts += [point, perm]
self.mounts += [[point, perm]]
def get_status(self):
"""Obtain the status of the services Docker container
......@@ -2270,6 +2271,10 @@ class ContainerDocker(Container):
for pubpath in listing:
if pubpath + ':' + pubpath not in args:
args += ['-v', pubpath + ':' + pubpath + ':ro']
for mount in self.mounts:
if not os.path.exists(mount[0]):
continue
args += ['-v', mount[0] + ':' + mount[0] + ':' + mount[0]]
# USER environment variable used for xauth operation
# Can't use the --user option because we need root to setup account and group information
......@@ -2381,7 +2386,7 @@ class ContainerDocker(Container):
# invoke rewrites the path... Is setting it ourselves useful?
args += ['-e', "PATH=%s" % "/bin:/usr/bin:/usr/bin/X11:/sbin:/usr/sbin"]
if params:
args += ['-e', "TOOL_PARAMETERS=\"%s\"" % account.int_params_path(session_id)]
args += ['-e', "TOOL_PARAMETERS=%s" % account.int_params_path(session_id)]
try:
if self.k["EXTRA_ENV_CMD"] != "":
......
......@@ -555,13 +555,13 @@ class Session:
# add host
if 'FRONT_LISTEN_HOST' in proxy_vars:
if proxy_vars['FRONT_LISTEN_HOST'] == '':
prefix = prefix + guess_weber_proxy(hub_url)
prefix = prefix + Session.guess_weber_proxy(hub_url)
else:
if DEBUG:
log("DEBUG: front listen host is '%s'" % str(proxy_vars['FRONT_LISTEN_HOST']))
prefix = prefix + str(proxy_vars['FRONT_LISTEN_HOST'])
else:
prefix = prefix + guess_weber_proxy(hub_url)
prefix = prefix + Session.guess_weber_proxy(hub_url)
# add port
if 'FRONT_LISTEN_PORT' in proxy_vars:
if proxy_vars['FRONT_LISTEN_PORT'] == 443:
......