Skip to content

Commit ec3723f

Browse files
committed
Made the svn and libsvn symlinking code more robust against bad settings.
- Legacy-Id: 12243
1 parent 288d211 commit ec3723f

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

ietf/checks.py

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -276,10 +276,19 @@ def check_svn_import(app_configs, **kwargs):
276276
break
277277
if site_packages_dir:
278278
for path in settings.SVN_PACKAGES:
279-
dir, name = os.path.split(path)
280-
package_link = os.path.join(site_packages_dir, name)
281-
if not os.path.exists(package_link):
282-
os.symlink(path, package_link)
279+
if os.path.exists(path):
280+
dir, name = os.path.split(path)
281+
package_link = os.path.join(site_packages_dir, name)
282+
if not os.path.lexists(package_link):
283+
os.symlink(path, package_link)
284+
else:
285+
errors.append(checks.Critical(
286+
"The setting SVN_PACKAGES specify a library path which\n"
287+
"does not exist:\n"
288+
" %s\n" % path,
289+
hint = "Please provide the correct python system site-package paths for\n"
290+
"svn and libsvn in SVN_PACKAGES.",
291+
id = "datatracker.E0015",))
283292
#
284293
if settings.SERVER_MODE == 'production':
285294
try:

0 commit comments

Comments
 (0)