Merge lp:~fo0bar/ubuntu-repository-cache/urc-avahi into lp:~tribaal/ubuntu-repository-cache/trunk

Proposed by Ryan Finnie
Status: Merged
Merged at revision: 240
Proposed branch: lp:~fo0bar/ubuntu-repository-cache/urc-avahi
Merge into: lp:~tribaal/ubuntu-repository-cache/trunk
Diff against target: 18 lines (+7/-1)
1 file modified
lib/ubuntu_repository_cache/squid.py (+7/-1)
To merge this branch: bzr merge lp:~fo0bar/ubuntu-repository-cache/urc-avahi
Reviewer Review Type Date Requested Status
Chris Glass Approve
Review via email: mp+324581@code.launchpad.net

Description of the change

Do not fail if avahi-daemon is not installed

To post a comment you must log in.
Revision history for this message
Chris Glass (tribaal) wrote :

LGTM!

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/ubuntu_repository_cache/squid.py'
2--- lib/ubuntu_repository_cache/squid.py 2017-03-27 14:50:39 +0000
3+++ lib/ubuntu_repository_cache/squid.py 2017-05-25 00:39:23 +0000
4@@ -93,7 +93,13 @@
5 release = lsb_release()['DISTRIB_RELEASE']
6
7 # We don't need avahi-daemon ...
8- host.service_pause('avahi-daemon')
9+ try:
10+ host.service_pause('avahi-daemon')
11+ except ValueError:
12+ # ValueError: Unable to detect avahi-daemon as SystemD, Upstart
13+ # /etc/init/avahi-daemon.conf or SysV /etc/init.d/avahi-daemon
14+ # If avahi-daemon isn't installed, do nothing
15+ pass
16
17 # ... or squid3 running
18 if release < '16.04': # before xenial

Subscribers

People subscribed via source and target branches

to all changes: