minor tweak of content of try for symlink creation and error content afterwards

This commit is contained in:
2024-06-29 13:55:43 +10:00
parent 29ea2ca833
commit 28d4f8d998

View File

@@ -1151,12 +1151,12 @@ def JobForceScan(job):
def CreateSymlink(job,ptype,path):
path_type = session.query(PathType).get(ptype)
symlink=SymlinkName(path_type.name, path, path)
try:
if not os.path.exists(symlink):
PAprint( f"INFO: symlink does not exist, actually creating it -- s={symlink}" )
try:
# SAFE: SafePath() on init forces symlink to be safe
os.makedirs( os.path.dirname(symlink), mode=0o777, exist_ok=True )
os.symlink(path, symlink)
r=os.makedirs( os.path.dirname(symlink), mode=0o777, exist_ok=True )
r=os.symlink(path, symlink)
except Exception as e:
AddLogForJob( job, f"ERROR: Failed to create symlink - tried to link {symlink} -> {path}: {e}")
return symlink
@@ -2434,7 +2434,7 @@ def InitialValidationChecks():
except Exception as ex:
PAprint( f"FATAL ERROR: Failed to walk the recycle bin at {path} Err:{ex}" )
else:
AddLogForJob(job, "ERROR: The bin path in settings does not exist - Please fix now");
AddLogForJob(job, f"ERROR: The bin path {path} in settings does not exist - Please fix now");
sp_exists=0
path = SettingsSPath()
if os.path.exists(path):