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 <[email protected]> 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 <[email protected]>:
>> 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: [email protected]
>> jabber: [email protected]
>
>
>
> --
> Vasiliy Tolstov,
> e-mail: [email protected]
> jabber: [email protected]
>
> --
> Juju-dev mailing list
> [email protected]
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju-dev
--
Juju-dev mailing list
[email protected]
Modify settings or unsubscribe at:
https://lists.ubuntu.com/mailman/listinfo/juju-dev