Comment 10 for bug 1712977

Revision history for this message
Haw Loeung (hloeung) wrote : Re: [Bug 1712977] Re: config-changed hook fails: nrpe_helpers.py:nagios_hostname in _metadata_unit with FileNotFoundError error for metadata.yaml of related unit on another host

On Thu, Aug 31, 2017 at 02:44:06PM -0000, Seyeong Kim wrote:
> I tried to deploy fresh simple ubuntu, nrpe, nagios charm ( relation is
> ubuntu, nrpe and nrpe:monitors, nagios:monitors)
>
> nagios has config-hooks error
>
> ERROR msg : global name 'self' is not defined
>
> which seems that caused from
>
> https://git.launchpad.net/nagios-
> charm/commit/?id=38f049516d4865a1e3c1fec5289f6f189fff0631
>
> + host_context = hookenv.config('nagios_host_context')
> + principal_unitname = hookenv.principal_unit()
> + # Fallback to using "primary" if it exists.
> + if not principal_unitname:
> + for relunit in self[self.name]:
> + if relunit.get('primary', 'False').lower() == 'true':
> + principal_unitname = relunit['__unit__']
> + break
>
> no error in your test env?
>

Can you provide the full traceback?

The code segment above is from the nrpe charm but you're reporting
config-changed in nagios itself?