Fix user uid and gid generation.

This commit is contained in:
Jeffrey Townsend
2016-07-19 14:38:12 +00:00
parent b19ec20227
commit e87e30a31e

View File

@@ -88,8 +88,10 @@ class OnlRfsSystemAdmin(object):
def useradd(self, username, uid=None, gid=None, password=None, shell='/bin/bash', home=None, groups=None, sudo=False, deleteFirst=True):
args = [ 'useradd', '--create-home' ]
if uid:
if uid is not None:
args = args + [ '--non-unique', '--uid', str(uid) ]
if gid is not None:
args = args + [ '--gid', str(gid) ]
if password:
epassword=crypt.crypt(password, '$1$%s$' % self.gen_salt());