summaryrefslogtreecommitdiffstats
path: root/users.py
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2006-07-28 20:21:52 +0000
committerJeremy Katz <katzj@redhat.com>2006-07-28 20:21:52 +0000
commitfa79bcd5e278c3be8c3c30ccb009f5c62bf2a9f1 (patch)
tree40713f912ee15ac5d073ea017acc9eb11bce4a70 /users.py
parent07fd45cf256752fcebd7719c4c1b9939c675931f (diff)
downloadanaconda-fa79bcd5e278c3be8c3c30ccb009f5c62bf2a9f1.tar.gz
anaconda-fa79bcd5e278c3be8c3c30ccb009f5c62bf2a9f1.tar.xz
anaconda-fa79bcd5e278c3be8c3c30ccb009f5c62bf2a9f1.zip
2006-07-28 Jeremy Katz <katzj@redhat.com>
* users.py (Users.createUser): Create users under the rootpath (Clark Williams) * instdata.py (InstallData.write): Use the rootpath
Diffstat (limited to 'users.py')
-rw-r--r--users.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/users.py b/users.py
index 588400c2d..3b44127e3 100644
--- a/users.py
+++ b/users.py
@@ -18,6 +18,7 @@ import crypt
import random
import tempfile
import os
+import os.path
def createLuserConf(instPath):
"""Writes a libuser.conf for instPath."""
@@ -59,7 +60,7 @@ class Users:
self.admin = libuser.admin()
def createUser (self, name, password=None, isCrypted=False, groups=[],
- homedir=None, shell=None, uid=None):
+ homedir=None, shell=None, uid=None, root="/mnt/sysimage"):
if self.admin.lookupUserByName(name):
return None
@@ -77,7 +78,7 @@ class Users:
homedir = "/home/" + name
# Do this to make the user's home dir under the install root.
- userEnt.set(libuser.HOMEDIRECTORY, "/mnt/sysimage/" + homedir)
+ userEnt.set(libuser.HOMEDIRECTORY, os.path.join(root, homedir))
if shell:
userEnt.set(libuser.LOGINSHELL, shell)