Merge lp:~cjwatson/charms/trusty/rutabaga/nrpe-compat into lp:~canonical-launchpad-branches/charms/trusty/rutabaga/devel

Proposed by Colin Watson
Status: Merged
Merged at revision: 37
Proposed branch: lp:~cjwatson/charms/trusty/rutabaga/nrpe-compat
Merge into: lp:~canonical-launchpad-branches/charms/trusty/rutabaga/devel
Diff against target: 53 lines (+23/-5)
2 files modified
hooks/actions.py (+12/-4)
hooks/services.py (+11/-1)
To merge this branch: bzr merge lp:~cjwatson/charms/trusty/rutabaga/nrpe-compat
Reviewer Review Type Date Requested Status
Guillermo Gonzalez (community) Approve
Launchpad code reviewers Pending
Review via email: mp+359748@code.launchpad.net

Commit message

Support newer versions of the nrpe charm.

Description of the change

This is a bit of a hack, but can be simplified once all deployments have been upgraded.

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

+1

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'hooks/actions.py'
--- hooks/actions.py 2016-12-09 13:08:30 +0000
+++ hooks/actions.py 2018-11-28 13:16:25 +0000
@@ -218,10 +218,18 @@
218 # Only makes sense with basenode.218 # Only makes sense with basenode.
219 if not config['log_hosts_allow']:219 if not config['log_hosts_allow']:
220 return220 return
221 concat_rsync_fragments = '/usr/local/bin/concat_rsync_fragments'221 # New versions of the nrpe charm use a different system that doesn't
222 if not os.path.exists(concat_rsync_fragments):222 # require manual concatenation.
223 return223 concat = True
224 subprocess.check_call([concat_rsync_fragments])224 if os.path.exists('/etc/rsyncd.conf'):
225 with open('/etc/rsyncd.conf') as rsyncd_conf:
226 if '&include /etc/rsync-juju.d' in rsyncd_conf.read():
227 concat = False
228 if concat:
229 concat_rsync_fragments = '/usr/local/bin/concat_rsync_fragments'
230 if not os.path.exists(concat_rsync_fragments):
231 return
232 subprocess.check_call([concat_rsync_fragments])
225 service_restart('rsync')233 service_restart('rsync')
226234
227235
228236
=== modified file 'hooks/services.py'
--- hooks/services.py 2016-04-25 16:51:10 +0000
+++ hooks/services.py 2018-11-28 13:16:25 +0000
@@ -22,11 +22,21 @@
22 owner=owner, group=group, perms=perms)22 owner=owner, group=group, perms=perms)
2323
2424
25def render_old_rsync_template(config):
26 if config['log_hosts_allow']:
27 return helpers.render_template(
28 source='rutabaga-rsync.j2',
29 target='/etc/rsyncd.d/010-rutabaga',
30 perms=0o644)
31 else:
32 return lambda _: None
33
34
25def render_rsync_template(config):35def render_rsync_template(config):
26 if config['log_hosts_allow']:36 if config['log_hosts_allow']:
27 return helpers.render_template(37 return helpers.render_template(
28 source='rutabaga-rsync.j2',38 source='rutabaga-rsync.j2',
29 target='/etc/rsyncd.d/010-rutabaga',39 target='/etc/rsync-juju.d/010-rutabaga.conf',
30 perms=0o644)40 perms=0o644)
31 else:41 else:
32 return lambda _: None42 return lambda _: None

Subscribers

People subscribed via source and target branches

to all changes: