gocharm help
roger peppe
roger.peppe at canonical.com
Thu Apr 23 08:00:21 UTC 2015
Nice start!
As far as I can see the issue is just that there's
a variant syntax of a relation that's allowed in the metadata
(I replied in the issue itself).
I had a brief look at your hooks.go file. I'd suggest that
it's probably better to register the hooks individually,
rather than using the switch (that way gocharm does the
work).
As it happens, the gocharm hook logic emits a log message
anyway when a hook starts and finishes, but if you
*do* want to wrap other generic logic around hooks, it's
probably better to use a "decorator" style than to
introduce the switch.
e.g.
func (n *mysql) registerHook(r *hook.Registry, name string, h
func() error) {
r.RegisterHook(name, func() error {
n.ctxt.Logf("running %s", name)
return h()
})
}
...
n.registerHook(r, "install", n.install)
Here's a paste of the code with a few suggested changes made:
http://paste.ubuntu.com/10870074/
Please let me know if you have any more issues (or, even better, if
it all just works ok for you :-] )
cheers,
rog.
On 23 April 2015 at 00:08, Vasiliy Tolstov <v.tolstov at selfip.ru> wrote:
> My first steps in github repo :
> https://github.com/vtolstov/charms/blob/master/mysql/runhook.go
>
> 2015-04-23 2:01 GMT+03:00 Vasiliy Tolstov <v.tolstov at selfip.ru>:
>> Hello, i'm try to investigate gocharm and i'm happy with it.
>> But i'm stuck ad this issues:
>> https://github.com/juju/gocharm/issues/44
>> can somebody helps me?
>>
>> --
>> Vasiliy Tolstov,
>> e-mail: v.tolstov at selfip.ru
>> jabber: vase at selfip.ru
>
>
>
> --
> Vasiliy Tolstov,
> e-mail: v.tolstov at selfip.ru
> jabber: vase at selfip.ru
>
> --
> Juju-dev mailing list
> Juju-dev at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/juju-dev
More information about the Juju-dev
mailing list