Merge ~xavpaice/charm-nagios:bug/1923407 into charm-nagios:master

Proposed by Xav Paice
Status: Merged
Merged at revision: 01d0db96c77da89c148fe5a7f459e4ae9aa9f9ae
Proposed branch: ~xavpaice/charm-nagios:bug/1923407
Merge into: charm-nagios:master
Diff against target: 16 lines (+2/-1)
1 file modified
hooks/upgrade_charm.py (+2/-1)
Reviewer Review Type Date Requested Status
Celia Wang Approve
James Troup (community) Needs Information
Review via email: mp+401263@code.launchpad.net
To post a comment you must log in.
Revision history for this message
James Troup (elmo) wrote :

Why wrap the chown/chmod in a blanket try? Is there a more specific exception you could catch?

review: Needs Information
Revision history for this message
Xav Paice (xavpaice) wrote :

thanks for that - I've updated the commit removing the try/except, following our conversation.

Revision history for this message
Celia Wang (ziyiwang) wrote :

LGTM

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1diff --git a/hooks/upgrade_charm.py b/hooks/upgrade_charm.py
2index ecf4c68..03f0845 100755
3--- a/hooks/upgrade_charm.py
4+++ b/hooks/upgrade_charm.py
5@@ -183,9 +183,10 @@ def enable_livestatus_config():
6 missing_packages = fetch.filter_installed_packages(["check-mk-livestatus"])
7 if missing_packages:
8 fetch.apt_install(missing_packages)
9+
10+ if not os.path.exists(livestatus_path):
11 # This needs a nagios restart to actually make the socket
12 host.service_reload("nagios3")
13-
14 # Fix the perms on the socket
15 hookenv.log("Fixing perms on the socket")
16 uid = pwd.getpwnam(nagios_user).pw_uid

Subscribers

People subscribed via source and target branches

to all changes: