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

Proposed by Haw Loeung
Status: Merged
Approved by: James Simpson
Approved revision: 6fdc670216f62d1edd3058340f02e2f2f0990778
Merged at revision: 3cfe9a0341d72e5ff993ff93bc01653b79deb7df
Proposed branch: ~hloeung/ubuntu-repository-cache:fixes
Merge into: ubuntu-repository-cache:master
Diff against target: 26 lines (+5/-1)
1 file modified
lib/ubuntu_repository_cache/metadata_sync.py (+5/-1)
Reviewer Review Type Date Requested Status
James Simpson Approve
Canonical IS Reviewers Pending
Review via email: mp+429471@code.launchpad.net

Commit message

Don't clean up _good for ubuntu_active and ubuntu_next

To post a comment you must log in.
Revision history for this message
James Simpson (jsimpso) wrote :

LGTM

review: Approve
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
🤖 Canonical IS Merge Bot (canonical-is-mergebot) wrote :

Change successfully merged at revision 3cfe9a0341d72e5ff993ff93bc01653b79deb7df

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 79acaf9..dd39ff9 100644
3--- a/lib/ubuntu_repository_cache/metadata_sync.py
4+++ b/lib/ubuntu_repository_cache/metadata_sync.py
5@@ -388,7 +388,7 @@ def rsync_should_giveup(exception):
6 return True # Do give up by default.
7
8
9-def clean_metadata_dir(apache_root, log, keep=None):
10+def clean_metadata_dir(apache_root, log, keep=None): # NOQA: C901
11 '''Delete non-active metadata directories'''
12
13 log('Cleaning metadata directory')
14@@ -423,8 +423,12 @@ def clean_metadata_dir(apache_root, log, keep=None):
15 if entry not in keep:
16 if entry == active:
17 log('ubuntu_active points to {}, skipping'.format(entry))
18+ elif entry == '_'.join((active, 'good')):
19+ log('ubuntu_active points to {}, skipping _good'.format(entry))
20 elif entry == ubuntu_next:
21 log('ubuntu_next points to {}, skipping'.format(entry))
22+ elif entry == '_'.join((ubuntu_next, 'good')):
23+ log('ubuntu_next points to {}, skipping _good'.format(entry))
24 elif os.path.isfile(entry):
25 # XXX: Should be a debug
26 log('Removing file {}'.format(entry))

Subscribers

People subscribed via source and target branches