Commit 030c6f70 authored by Xavier Thompson's avatar Xavier Thompson

slapformat: WIP: Add user getIds method

parent c30ff5f7
......@@ -381,8 +381,8 @@ class Partition(object):
def createPath(self):
if not os.path.exists(self.path):
os.mkdir(self.path)
owner_pw = pwd.getpwnam(self.user.name)
os.chown(self.path, owner_pw.pw_uid, owner_pw.pw_gid)
uid, gid = self.user.getIds()
os.chown(self.path, uid, gid)
os.chmod(self.path, 0o750)
......@@ -415,6 +415,10 @@ class User(object):
# lock the password of user
call(['passwd', '-l', self.name])
def getIds(self):
pw = pwd.getpwnam(self.name)
return pw.pw_uid, pw.pw_gid
@classmethod
def isGroupAvailable(cls, name):
try:
......
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