Merge lp:~thomir-deactivatedaccount/charms/trusty/tanuki-result-enum-api/charm-remove-nagios-checks into lp:~tanuki/charms/trusty/tanuki-result-enum-api/trunk

Proposed by Thomi Richards
Status: Merged
Approved by: Thomi Richards
Approved revision: 22
Merged at revision: 22
Proposed branch: lp:~thomir-deactivatedaccount/charms/trusty/tanuki-result-enum-api/charm-remove-nagios-checks
Merge into: lp:~tanuki/charms/trusty/tanuki-result-enum-api/trunk
Diff against target: 13 lines (+3/-0)
1 file modified
hooks/actions.py (+3/-0)
To merge this branch: bzr merge lp:~thomir-deactivatedaccount/charms/trusty/tanuki-result-enum-api/charm-remove-nagios-checks
Reviewer Review Type Date Requested Status
Guillermo Gonzalez Approve
Review via email: mp+272673@code.launchpad.net

Commit message

Fix a bug where, if nagios checks are not already installed, the charm will fail.

Description of the change

Fix a bug where, if nagios checks are not already installed, the charm will fail.

To post a comment you must log in.
Revision history for this message
Guillermo Gonzalez (verterok) wrote :

+1

Just a FYI, there is no need to copy stuff around. Using the full path should be enough

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/actions.py'
2--- hooks/actions.py 2015-09-28 01:17:48 +0000
3+++ hooks/actions.py 2015-09-28 22:42:18 +0000
4@@ -209,6 +209,9 @@
5 filename
6 )
7 dst = os.path.join('/usr/lib/nagios/plugins', filename)
8+ dst_dir = os.path.dirname(dst)
9+ if not os.path.exists(dst_dir):
10+ os.makedirs(dst_dir)
11 shutil.copy(src, dst)
12 os.chmod(dst, 0o755)
13 nrpe_compat = nrpe.NRPE()

Subscribers

People subscribed via source and target branches

to all changes: