Commit e84b9436 authored by Charlie Jacomme's avatar Charlie Jacomme

created homes must be relative symlink

parent 1d7bd1da
......@@ -26,7 +26,7 @@ def reconfigure(api_client):
users = api_client.list("users/homecreation")
error = False
os.chdir("/home-adh")
for user in users:
home = '/home-adh/{}/{}'.format(user['pseudo'][0].lower(),user['pseudo'].lower())
uid = user['uid']
......@@ -53,7 +53,9 @@ def reconfigure(api_client):
# Simlink
link = '/home-adh/{}'.format(user['pseudo'].lower())
if not os.path.islink(link):
os.symlink(home, link)
link2 = '{}'.format(user['pseudo'].lower())
home2 = '{}/{}'.format(user['pseudo'][0].lower(),user['pseudo'].lower())
os.symlink(home2, link2)
if not ((os.path.exists(home+'/Mail') or os.path.islink(home + '/Mail')) and (os.path.exists(home+'/OwnCloud') or os.path.islink(home + '/OwnCloud')) and os.path.islink(link)):
print('creation du home de {}'.format(user['pseudo']))
......
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