minor tweak of content of try for symlink creation and error content afterwards
This commit is contained in:
@@ -1151,14 +1151,14 @@ def JobForceScan(job):
|
|||||||
def CreateSymlink(job,ptype,path):
|
def CreateSymlink(job,ptype,path):
|
||||||
path_type = session.query(PathType).get(ptype)
|
path_type = session.query(PathType).get(ptype)
|
||||||
symlink=SymlinkName(path_type.name, path, path)
|
symlink=SymlinkName(path_type.name, path, path)
|
||||||
if not os.path.exists(symlink):
|
try:
|
||||||
PAprint( f"INFO: symlink does not exist, actually creating it -- s={symlink}" )
|
if not os.path.exists(symlink):
|
||||||
try:
|
PAprint( f"INFO: symlink does not exist, actually creating it -- s={symlink}" )
|
||||||
# SAFE: SafePath() on init forces symlink to be safe
|
# SAFE: SafePath() on init forces symlink to be safe
|
||||||
os.makedirs( os.path.dirname(symlink), mode=0o777, exist_ok=True )
|
r=os.makedirs( os.path.dirname(symlink), mode=0o777, exist_ok=True )
|
||||||
os.symlink(path, symlink)
|
r=os.symlink(path, symlink)
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
AddLogForJob( job, f"ERROR: Failed to create symlink - tried to link {symlink} -> {path}: {e}")
|
AddLogForJob( job, f"ERROR: Failed to create symlink - tried to link {symlink} -> {path}: {e}")
|
||||||
return symlink
|
return symlink
|
||||||
|
|
||||||
##############################################################################
|
##############################################################################
|
||||||
@@ -2434,7 +2434,7 @@ def InitialValidationChecks():
|
|||||||
except Exception as ex:
|
except Exception as ex:
|
||||||
PAprint( f"FATAL ERROR: Failed to walk the recycle bin at {path} Err:{ex}" )
|
PAprint( f"FATAL ERROR: Failed to walk the recycle bin at {path} Err:{ex}" )
|
||||||
else:
|
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
|
sp_exists=0
|
||||||
path = SettingsSPath()
|
path = SettingsSPath()
|
||||||
if os.path.exists(path):
|
if os.path.exists(path):
|
||||||
|
|||||||
Reference in New Issue
Block a user