Skip to content

Commit 891b499

Browse files
committed
Fix a couple of symlink checks to actually see if the symlink itself exists rather than if the path pointed to exists. Addresses a regression in edituser with the unique id symlinks not being properly removed in preparation for relinking it to the new X509 ID.
git-svn-id: svn+ssh://svn.code.sf.net/p/migrid/code/trunk@6091 b75ad72c-e7d7-11dd-a971-7dbc132099af
1 parent d0b426d commit 891b499

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

mig/shared/useradm.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ def create_alias_link(username, client_id, user_home):
133133
client_dir = client_id_dir(client_id)
134134
home_dir = os.path.join(user_home, client_dir)
135135
link_path = os.path.join(user_home, username)
136-
if os.path.exists(link_path):
136+
if os.path.islink(link_path):
137137
return True
138138
try:
139139
os.symlink(client_dir, link_path)
@@ -804,7 +804,7 @@ def create_user_in_fs(configuration, client_id, user, now, renew, force, verbose
804804
continue
805805
_logger.debug("handling link to %s in %s" % (target_dir,
806806
target_link))
807-
if os.path.exists(target_link):
807+
if os.path.islink(target_link):
808808
_logger.debug("remove old link in %s" % target_link)
809809
delete_symlink(target_link, _logger)
810810
else:

0 commit comments

Comments
 (0)