Commit 91b2a1cf authored by Pascal Meunier's avatar Pascal Meunier

change : to _ in Docker hostname; and bug fix, 'HELPER_GID' is a string so...

change : to _ in Docker hostname; and bug fix, 'HELPER_GID' is a string so requires s in format string, not d
parent 92fc6979
......@@ -2175,9 +2175,9 @@ class ContainerDocker(Container):
args += ['-e', 'etcshadow=' + user + ':!:17052:0:99999:7:::\n']
# set hostname displayed at prompt inside container
if 'DOCKER_HOSTNAME' in self.k:
args += ['-h', self.k['DOCKER_HOSTNAME'] + "_%s:%d" % (session_id, self.veid)]
args += ['-h', self.k['DOCKER_HOSTNAME'] + "_%s_%d" % (session_id, self.veid)]
else:
args += ['-h', "docker%d" % self.veid]
args += ['-h', "docker_%s_%d" % (session_id, self.veid)]
if 'apps' in account.groups():
# add the apps user and edit the sudoers file to allow su to apps
apps_user = make_User_account('apps', self.k)
......@@ -2199,7 +2199,7 @@ class ContainerDocker(Container):
args += ['-e', 'etcpasswdhelper=ionhelper:x:199:199::/var/ion/:/bin/false\n']
args += ['-e', 'etcshadowhelper=ionhelper:*:17821:0:99999:7:::\n']
# add the user to the ionhelper group
args += ['-e', "group_ionhelper=%s:x:%d:%s\n" % ('ionhelper', 199, user)]
args += ['-e', "group_ionhelper=ionhelper:x:%d:%s\n" % (199, user)]
# provide information to copy resource file
# path to copy from, path to copy to, session id
sessiondir_helper = '/var/ion/data/sessions/%s' % (session_id)
......@@ -2215,8 +2215,8 @@ class ContainerDocker(Container):
elif 'HELPER' in self.k:
args += ['-e', 'etcpasswdhelper=%s:x:%s:%s::%s:/bin/false\n' % (self.k['HELPER'], self.k['HELPER_UID'], self.k['HELPER_GID'], self.k['HELPER_HOME'])]
args += ['-e', 'etcshadowhelper=%s:*:17821:0:99999:7:::\n' % self.k['HELPER']]
# add the user to the ionhelper group
args += ['-e', "group_%s=%s:x:%d:%s,%s\n" % (self.k['HELPER'], self.k['HELPER'], self.k['HELPER_GID'], user, self.k['HELPER'])]
# add the user to the helper group. note self.k['HELPER_GID'] is actually a string so use %s
args += ['-e', "group_%s=%s:x:%s:%s,%s\n" % (self.k['HELPER'], self.k['HELPER'], self.k['HELPER_GID'], user, self.k['HELPER'])]
# provide information to copy resource file
# path to copy from, path to copy to, session id
sessiondir_helper = "%s/data/sessions/%s" % (self.k['HELPER_HOME'], session_id)
......
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