Skip to content
Snippets Groups Projects
Commit 3e1029fe authored by Erik Johnston's avatar Erik Johnston
Browse files

Warn if we encounter unexpected files in config directories

parent bfb66773
No related branches found
No related tags found
No related merge requests found
...@@ -159,13 +159,23 @@ class Config(object): ...@@ -159,13 +159,23 @@ class Config(object):
# We accept specifying directories as config paths, we search # We accept specifying directories as config paths, we search
# inside that directory for all files matching *.yaml, and then # inside that directory for all files matching *.yaml, and then
# we apply them in *sorted* order. # we apply them in *sorted* order.
config_files.extend(sorted( files = []
os.path.join(config_path, entry) for entry in os.listdir(config_path):
for entry in os.listdir(config_path) entry_path = os.path.join(config_path, entry)
if entry.endswith(".yaml") and os.path.isfile( if not os.path.isfile(entry_path):
os.path.join(config_path, entry) print (
) "Found subdirectory in config directory: %r. IGNORING."
)) ) % (entry_path, )
continue
if not entry.endswith(".yaml"):
print (
"Found file in config directory that does not"
" end in '.yaml': %r. IGNORING."
) % (entry_path, )
continue
config_files.extend(sorted(files))
else: else:
config_files.append(config_path) config_files.append(config_path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment