empty .juju-persistent-config breaks charm hooks

Bug #1768018 reported by Edward Hope-Morley
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Charm Helpers
Fix Released
Medium
Edward Hope-Morley

Bug Description

If for whatever reason you have an empty .juju-persistent-config state file (normally contains values of previously set config opts calls to Config.config() will fail with e.g.

2018-04-27 14:32:14 INFO config-changed Traceback (most recent call last):
2018-04-27 14:32:14 INFO config-changed File "/var/lib/juju/agents/unit-hacluster-rados-1/charm/hooks/config-changed", line 481, in <module>
2018-04-27 14:32:14 INFO config-changed hooks.execute(sys.argv)
2018-04-27 14:32:14 INFO config-changed File "/var/lib/juju/agents/unit-hacluster-rados-1/charm/hooks/charmhelpers/core/hookenv.py", line 805, in execute
2018-04-27 14:32:14 INFO config-changed self._hooks[hook_name]()
2018-04-27 14:32:14 INFO config-changed File "/var/lib/juju/agents/unit-hacluster-rados-1/charm/hooks/config-changed", line 157, in config_changed
2018-04-27 14:32:14 INFO config-changed update_nrpe_config()
2018-04-27 14:32:14 INFO config-changed File "/var/lib/juju/agents/unit-hacluster-rados-1/charm/hooks/config-changed", line 450, in update_nrpe_config
2018-04-27 14:32:14 INFO config-changed nrpe_setup = nrpe.NRPE(hostname=hostname)
2018-04-27 14:32:14 INFO config-changed File "/var/lib/juju/agents/unit-hacluster-rados-1/charm/hooks/charmhelpers/contrib/charmsupport/nrpe.py", line 244, in __init__
2018-04-27 14:32:14 INFO config-changed self.nagios_context = self.config['nagios_context']
2018-04-27 14:32:14 INFO config-changed TypeError: 'NoneType' object has no attribute '__getitem__'

Changed in charm-helpers:
status: New → In Progress
assignee: nobody → Edward Hope-Morley (hopem)
Revision history for this message
Edward Hope-Morley (hopem) wrote :
Changed in charm-helpers:
importance: Undecided → Critical
importance: Critical → Medium
Changed in charm-helpers:
status: In Progress → Fix Released
Revision history for this message
Trent Lloyd (lathiat) wrote :

This fix didn't appear to work (at least in some cases), new fix:
https://github.com/juju/charm-helpers/pull/484

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.