debug-code fails if hook doesn't exist
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Canonical Juju |
Fix Released
|
High
|
John A Meinel |
Bug Description
If you run 'juju debug-hooks' then Juju will always trigger an event for every hook, whether or not it exists.
It was designed to do this so that someone debugging a charm could see that there is a lifecycle event, even if the hook isn't implemented, in case they want to actually start to implement it.
Which is fine, if a human tries to run './hooks/
However, debug-code acts differently, in that it goes ahead and runs ./hooks/install (etc) so that the code being executed has a chance to actually run and grab an internal debugger.
However, if the charm doesn't implement a hook, then it gets a bad error that just keeps happening in the log:
unit-dummy-sink-0: 15:41:57 ERROR juju.worker.
An easy way to test it is
cd acceptancetests
juju deploy ./dummy-sink
juju deploy ./dummy-source
juju debug-code dummy-source/0
in another terminal
juju relate dummy-sink dummy-source
and you see 'source-
Actually, debug-hooks itself acts a bit silly, as it ends up printing:
3. To run an action or hook and end the debugging session avoiding processing any more events manually, use:
./
We should probably change the splash message a bit more if the hook is not implemented.
Changed in juju: | |
status: | Fix Committed → Fix Released |
https:/ /github. com/juju/ juju/pull/ 11527