This commit is contained in:
Brian Lindner 2022-10-23 17:02:14 -04:00
parent b95c1b2aae
commit d000b6266b
No known key found for this signature in database

View File

@ -297,25 +297,27 @@ def schedulefile_contents(schedule_filename: Optional[str]) -> dict[str, any]:
if schedule_filename not in ("", None):
if os.path.exists(str(schedule_filename)):
filename = schedule_filename
logger.debug('using specified schedule file "%s"', filename)
else:
msg = f'Pre-roll Schedule file "{schedule_filename}" not found'
logger.error(msg)
raise FileNotFoundError(msg)
else:
for f in default_files:
if os.path.exists(f):
filename = f
default_file = os.path.join(script_dir, f)
if os.path.exists(default_file):
filename = default_file
logger.debug('using default schedule file "%s"', filename)
break
logger.debug('using schedule file "%s"', filename)
# if we still cant find a schedule file, we abort
if not filename:
filestr = '" / "'.join(default_files)
logger.error('Missing schedule file: "%s"', filestr)
raise FileNotFoundError(filestr)
schema_filename = script_dir + "/" + "util/schedulefile_schema.json"
schema_filename = os.path.join(script_dir, "util/schedulefile_schema.json")
logger.debug('using schema validation file "%s"', schema_filename)