Creation works

This commit is contained in:
Michael McGrath 2008-03-06 21:06:06 -06:00
parent 0288432754
commit a9a53b5dc7

View file

@ -28,7 +28,7 @@ import tempfile
from fedora.tg.client import BaseClient, AuthError, ServerError from fedora.tg.client import BaseClient, AuthError, ServerError
from optparse import OptionParser from optparse import OptionParser
from shutil import move, rmtree, copy from shutil import move, rmtree, copytree
from rhpl.translate import _ from rhpl.translate import _
import ConfigParser import ConfigParser
@ -268,18 +268,9 @@ class MakeShellAccounts(BaseClient):
home_dir = os.path.join(home_base, person['username']) home_dir = os.path.join(home_base, person['username'])
if not os.path.exists(home_dir) and self.valid_user(person['username']): if not os.path.exists(home_dir) and self.valid_user(person['username']):
syslog.syslog('Creating homedir for %s' % person['username']) syslog.syslog('Creating homedir for %s' % person['username'])
os.makedirs(home_dir, mode=0755) copytree('/etc/skel/', home_dir)
try:
copy('/etc/skel/.*', home_dir)
except IOError:
pass
try:
copy('/etc/skel/*', home_dir)
except IOError:
pass
os.path.walk(home_dir, _chown, [person['id'], person['id']]) os.path.walk(home_dir, _chown, [person['id'], person['id']])
def enable(): def enable():
temp = tempfile.mkdtemp('-tmp', 'fas-', config.get('global', 'temp')) temp = tempfile.mkdtemp('-tmp', 'fas-', config.get('global', 'temp'))