Merge ~hloeung/ubuntu-repository-cache:fixes into ubuntu-repository-cache:master

Proposed by Haw Loeung
Status: Merged
Approved by: Paul Collins
Approved revision: 337c252504f60701264b12ddd81ccd373305c0f5
Merged at revision: ebb84e3d9c052ba0b1d3eba5e0082b588ea0291c
Proposed branch: ~hloeung/ubuntu-repository-cache:fixes
Merge into: ubuntu-repository-cache:master
Diff against target: 14 lines (+3/-0)
1 file modified
lib/ubuntu_repository_cache/metadata_sync.py (+3/-0)
Reviewer Review Type Date Requested Status
Paul Collins lgtm Approve
Canonical IS Reviewers Pending
Review via email: mp+430593@code.launchpad.net

Commit message

Don't run cleanup when ubuntu_active does not exist

To post a comment you must log in.
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

This merge proposal is being monitored by mergebot. Change the status to Approved to merge.

Revision history for this message
Paul Collins (pjdc) :
review: Approve (lgtm)
Revision history for this message
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision ebb84e3d9c052ba0b1d3eba5e0082b588ea0291c

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/ubuntu_repository_cache/metadata_sync.py b/lib/ubuntu_repository_cache/metadata_sync.py
2index 06728a3..ab6791a 100644
3--- a/lib/ubuntu_repository_cache/metadata_sync.py
4+++ b/lib/ubuntu_repository_cache/metadata_sync.py
5@@ -397,6 +397,9 @@ def clean_metadata_dir(apache_root, log, keep=None): # NOQA: C901
6 active = os.path.realpath('/'.join((apache_data, 'ubuntu_active')))
7 canary = '_'.join((active, 'good'))
8 keep = set((active, canary))
9+ if not os.path.exists(active):
10+ log('Not running cleanup as ubuntu_active does not exist')
11+ return
12 log('ubuntu_active currently points at: {}'.format(active))
13 else:
14 log('Keeping list provided: {}'.format(', '.join(keep)))

Subscribers

People subscribed via source and target branches