[Review Queue] nrpe, amulet

2015-04-23 Thread Adam Israel
trusty/nrpe - services framework rewrite

This charm had a few minor issues in the unit tests, which have now been
resolved, and the copyright info has been updated for non-Canonical
plugins. +1

https://code.launchpad.net/~gnuoy/charms/trusty/nrpe/services-rewrite/+merge/253799


 amulet

Following up on a pull request I submitted last week, I discovered that
I'd missed the underlying bug. The fix has been refactored and the pull
request updated. This fix unblocks the ubuntu-repository-cache charm.

https://github.com/juju/amulet/pull/67

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: gocharm help

2015-04-23 Thread roger peppe
On 23 April 2015 at 16:01, Vasiliy Tolstov  wrote:
> 2015-04-23 11:00 GMT+03:00 roger peppe :
>> 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 :-] )
>
>
> Thanks for suggestions, i'm try to write simple wordpress charm and
> check relations =)
> Last question - what benefits of using simplerelation package or
> writing own relations packages?

simplerelation is intended as a base for writing any relation
that has a simple "providers sets attributes, requirers see
them" convention.

So if the relation you want to write fits that convention, simplerelation
is probably the thing to use (if you look in the charmbits directory,
you'll see that some of the other relations already layer on top of it)

simplerelation is not really intended for using directly in a charm - the
idea is that if you want to implement a relation interface, you'll
make a package containing Provider and Requirer types and use
simplerelation to implement them if appropriate.

> Also, why in case of registered relation gocharm does not create
> symlinks for this relation?

I don't understand this question. Are you saying that you include
a relation-implementor in your type and call Register on it
but that hooks are not generated? (FWIW gocharm never makes
symlinks - it makes stub shell scripts instead)

Perhaps you could provide an example that doesn't work for you
and say what you expect it to do?

Ah! After looking at your code, I think I might know what your
question means. Do you mean "If I call RegisterRelation, why
does gocharm not generate relation hooks for that relation?".
If so, the answer is that gocharm only generates a hook stub when
you've called RegisterHook for that hook (it can't know
*which* hooks you want to be called. RegisterRelation just
registers the relation; it doesn't say that you're interested in hook
invocations
for that relation. See charmbits/httprelation for an example
of how to implement a relation.

  cheers,
rog.

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: gocharm help

2015-04-23 Thread Vasiliy Tolstov
2015-04-23 18:01 GMT+03:00 Vasiliy Tolstov :
> Thanks for suggestions, i'm try to write simple wordpress charm and
> check relations =)
> Last question - what benefits of using simplerelation package or
> writing own relations packages?


Also, why in case of registered relation gocharm does not create
symlinks for this relation?

-- 
Vasiliy Tolstov,
e-mail: v.tols...@selfip.ru
jabber: v...@selfip.ru

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: gocharm help

2015-04-23 Thread Vasiliy Tolstov
2015-04-23 11:00 GMT+03:00 roger peppe :
> 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 :-] )


Thanks for suggestions, i'm try to write simple wordpress charm and
check relations =)
Last question - what benefits of using simplerelation package or
writing own relations packages?

-- 
Vasiliy Tolstov,
e-mail: v.tols...@selfip.ru
jabber: v...@selfip.ru

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: 'ERROR juju.cmd supercommand.go:430 no instances found' when bootstrapping Juju on OpenStack Juno

2015-04-23 Thread Martin Packman
On 23/04/2015, Robert Day  wrote:
> Martin, Mark,
>
> Thank you! That was indeed the problem - once I'd changed that entry to an
> IP address (and fixed a couple of similar problems with my metadata files
> not being accessible, where the error messages were much easier to diagnose
> from), everything started working, and I've now successfully got my charms
> working on my OpenStack environment.

Great!

I put up a branch last night to make the error handling when listing
instances in the openstack provider saner, so this kind of thing
should be easier to diagnose in future.

Martin

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


RE: 'ERROR juju.cmd supercommand.go:430 no instances found' when bootstrapping Juju on OpenStack Juno

2015-04-23 Thread Robert Day
Martin, Mark,

Thank you! That was indeed the problem - once I'd changed that entry to an IP 
address (and fixed a couple of similar problems with my metadata files not 
being accessible, where the error messages were much easier to diagnose from), 
everything started working, and I've now successfully got my charms working on 
my OpenStack environment.

Thanks again,
Rob

>> -Original Message-
>> From: Martin Packman [mailto:martin.pack...@canonical.com]
>> Sent: 22 April 2015 18:01
>> To: Robert Day
>> Cc: juju@lists.ubuntu.com; Mark Wenning
>> Subject: Re: 'ERROR juju.cmd supercommand.go:430 no instances found'
>> when bootstrapping Juju on OpenStack Juno
>> 
>> On 16/04/2015, Robert Day  wrote:
>> >
>> > I'm trying to set up Juju on my private OpenStack Juno cloud, but
>> > 'juju bootstrap' is consistently failing with 'ERROR juju.cmd
>> > supercommand.go:430 no instances found'. My juju-core package version
>> > is 1.22.1-0ubuntu1~12.04.1~juju1.
>> 
>> Having looked at some logs kindly forwarded by Mark, I don't have a
>> definitive diagnostic, but have got an educated guess.
>> 
>> > auth-url: http://obuenfvm1:5000/v2.0/
>> 
>> Can an instance within the cloud resolve this address? Once the state server
>> is up, it also needs to be able to talk to the api endpoints, and that seems 
>> to
>> be where it's failing.
>> 
>> As the machine is still up after bootstrap fails, you should be able to ssh 
>> in
>> and confirm if the routing works. Otherwise, look in /var/log/juju and check
>> with upstart if jujud had issues starting up.
>> 
>> We have a bug filed already about the final error message being unhelpful,
>> that I've been meaning to get round to fixing for a while:
>> 
>> 
>> 
>> Martin
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju


Re: gocharm help

2015-04-23 Thread roger peppe
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  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 :
>> 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.tols...@selfip.ru
>> jabber: v...@selfip.ru
>
>
>
> --
> Vasiliy Tolstov,
> e-mail: v.tols...@selfip.ru
> jabber: v...@selfip.ru
>
> --
> Juju-dev mailing list
> juju-...@lists.ubuntu.com
> Modify settings or unsubscribe at: 
> https://lists.ubuntu.com/mailman/listinfo/juju-dev

-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju