Merge ~xavpaice/charm-nrpe:lp1711473 into ~nrpe-charmers/charm-nrpe:master

Proposed by Xav Paice
Status: Merged
Approved by: James Hebden
Approved revision: a4725a7ab1493bf8e71d6a254690b0db440dee47
Merge reported by: Xav Paice
Merged at revision: a4725a7ab1493bf8e71d6a254690b0db440dee47
Proposed branch: ~xavpaice/charm-nrpe:lp1711473
Merge into: ~nrpe-charmers/charm-nrpe:master
Diff against target: 15 lines (+3/-1)
1 file modified
hooks/nrpe_helpers.py (+3/-1)
Reviewer Review Type Date Requested Status
James Hebden (community) Approve
Review via email: mp+329238@code.launchpad.net
To post a comment you must log in.
Revision history for this message
James Hebden (ec0) wrote :

LGTM

Revision history for this message
James Hebden (ec0) 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/nrpe_helpers.py b/hooks/nrpe_helpers.py
2index bacf821..ef54511 100644
3--- a/hooks/nrpe_helpers.py
4+++ b/hooks/nrpe_helpers.py
5@@ -156,7 +156,9 @@ class PrincipalRelation(helpers.RelationContext):
6 host_context = hookenv.config('nagios_host_context')
7 hostname_type = hookenv.config('nagios_hostname_type')
8 if hostname_type == 'host' or not self.is_ready():
9- return socket.gethostname()
10+ nagios_hostname = "{}-{}".format(host_context,
11+ socket.gethostname())
12+ return nagios_hostname
13 else:
14 principal_unitname = hookenv.principal_unit()
15 # Fallback to using "primary" if it exists.

Subscribers

People subscribed via source and target branches