From ce59bc333586433a04744de5f55423a6376a3c04 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sybren=20A=2E=20St=C3=BCvel?= Date: Wed, 13 Sep 2017 10:21:30 +0200 Subject: [PATCH] Orphan finder: write file object IDs to orphan-files.txt --- pillar/cli/maintenance.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pillar/cli/maintenance.py b/pillar/cli/maintenance.py index 3da511d9..32edec24 100644 --- a/pillar/cli/maintenance.py +++ b/pillar/cli/maintenance.py @@ -647,3 +647,7 @@ def find_orphan_files(proj_url): end_timestamp = datetime.datetime.now() duration = end_timestamp - start_timestamp log.info('Finding orphans took %s', duration) + + log.info('Writing Object IDs to orphan-files.txt') + with open('orphan-files.txt', 'w') as outfile: + outfile.write('\n'.join(str(oid) for oid in sorted(orphans)) + '\n')