Comment 3 for bug 1247636

Revision history for this message
Erik B. Andersen (azendale) wrote : Re: etherpad lite fails to deploy, install hook running get relation

marcoceppi gave some feedback on IRC:

(02:55:31 PM) Azendale: marcoceppi: The change I made on the bug I filed was just to get it to work. But I'm really new to charm stuff (but used to python), so I don't know exactly what is the bug.
(02:55:53 PM) marcoceppi: Azendale: well, you can't (and shouldn't) be able to call relation-get from install hook
(02:56:01 PM) Azendale: marcoceppi: I'm not sure if that function should not be called in the first place in an install hook, or if the function should just return None
(02:56:04 PM) marcoceppi: so it seems the charm is doing something wrong
(02:57:13 PM) marcoceppi: Azendale: but there's nothing wrong with building in guards. So charmhelpers is a set of scripts designed to solve common problems that charm authors have. One problem is making writing charms in python easier. So that's why you have decorators and methods in python that streamline communication to juju commands
(02:57:58 PM) Azendale: marcoceppi: So, you're saying maybe fix the bug in two places, and then it's less likely to come up again in some other charm
(02:59:03 PM) marcoceppi: Azendale: the real problem is in the install hook, it shouldn't be calling that, and if it is, it needs to guard when results aren't available
(02:59:20 PM) marcoceppi: Azendale: the change to charmhelpers is a nice addition, not really a bug fix per se
(02:59:23 PM) marcoceppi: Azendale: but still
(03:01:06 PM) marcoceppi: Azendale: actually, having it fail like this when a relation_id isn't found is probably a good thing. Silently continuing when the method is called out of place could lead to weird results