botmeta sanity: check migrated_to on non-existing file (#64551)

pull/64672/head
Martin Krizek 5 years ago committed by Brian Coca
parent e5c1de29a8
commit c4b83619a6

@ -80,10 +80,11 @@ def main():
path_macros.append(macro)
# Ensure all `files` correspond to a file
for file in botmeta['files']:
for file, file_meta in botmeta['files'].items():
migrated = isinstance(file_meta, dict) and file_meta.get('migrated_to') is not None
for macro in path_macros:
file = file.replace('$' + macro, botmeta.get('macros', {}).get(macro, ''))
if not os.path.exists(file):
if not os.path.exists(file) and not migrated:
# Not a file or directory, though maybe the prefix to one?
# https://github.com/ansible/ansibullbot/pull/1023
if not glob.glob('%s*' % file):

Loading…
Cancel
Save