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

Proposed by Haw Loeung
Status: Merged
Approved by: Haw Loeung
Approved revision: bc59988f64230b95f3d09bd79d3df272fdc8a03b
Merged at revision: a0599fb7616410e0c3de620f4a69f933d6c40271
Proposed branch: ~hloeung/ubuntu-repository-cache:fixes
Merge into: ubuntu-repository-cache:master
Diff against target: 20 lines (+8/-1)
1 file modified
lib/ubuntu_repository_cache/squid.py (+8/-1)
Reviewer Review Type Date Requested Status
Junien F Approve
Canonical IS Reviewers Pending
Review via email: mp+435613@code.launchpad.net

Commit message

Fix failure trying to initialise squid caches by calling wrong squid command/binary

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
Junien F (axino) wrote :

+1

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

Change successfully merged at revision a0599fb7616410e0c3de620f4a69f933d6c40271

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/lib/ubuntu_repository_cache/squid.py b/lib/ubuntu_repository_cache/squid.py
2index e3b15cd..2ddf436 100644
3--- a/lib/ubuntu_repository_cache/squid.py
4+++ b/lib/ubuntu_repository_cache/squid.py
5@@ -32,7 +32,14 @@ def init_caches():
6 if not unitdata.kv().get('squid-disk-caches'):
7 LOG('No on disk cache directories founds for squid.', hookenv.ERROR)
8 return
9- subprocess.check_call(['/usr/sbin/squid3', '-N', '-z', '-f', '/etc/squid-deb-proxy/squid-deb-proxy.conf'])
10+
11+ release = lsb_release()['DISTRIB_RELEASE']
12+ if release < '16.04': # before xenial
13+ squid_cmd = '/usr/sbin/squid3'
14+ else:
15+ squid_cmd = '/usr/sbin/squid'
16+
17+ subprocess.check_call([squid_cmd, '-N', '-z', '-f', '/etc/squid-deb-proxy/squid-deb-proxy.conf'])
18
19
20 def size_caches(system_total_memory=0):

Subscribers

People subscribed via source and target branches