We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 20f1247 commit 560402aCopy full SHA for 560402a
neurodocker/generators/common.py
@@ -69,8 +69,10 @@ def add(cls, user):
69
if user not in cls.initialized_users:
70
cls.initialized_users.add(user)
71
return (
72
- "useradd --no-user-group --create-home --shell /bin/bash {0}".
73
- format(user))
+ # Test whether the user exists. If not, add user.
+ 'test "$(getent passwd {0})" ||'
74
+ ' useradd --no-user-group --create-home --shell /bin/bash {0}'
75
+ .format(user))
76
else:
77
return False
78
0 commit comments