Re: How to count relations?

2017-06-09 Thread Alex Kavanagh
On Thu, Jun 8, 2017 at 2:38 PM, Cory Johns wrote: > Alex, > > I should clarify, conv.scope should only be None if the class's scope is > GLOBAL. Otherwise, it should be the name of the service or unit. If the > scope is defined as SERVICE or UNIT and the conv.scope is

Re: How to count relations?

2017-06-08 Thread Cory Johns
Alex, I should clarify, conv.scope should only be None if the class's scope is GLOBAL. Otherwise, it should be the name of the service or unit. If the scope is defined as SERVICE or UNIT and the conv.scope is None, it was a bug, yes (but let's work to get rid of the confusing idea of scopes and

Re: How to count relations?

2017-06-07 Thread Alex Kavanagh
On Wed, Jun 7, 2017 at 4:44 PM, Cory Johns wrote: > Alex beat me to it, but here's a marginally more complete example: > https://gist.github.com/johnsca/a91cb5897d92dfb6741ee1a09d82b39b > > The key points are: > > * The interface needs to be UNIT scoped (because you

Re: How to count relations?

2017-06-07 Thread fengxia
Cory, Alex, good pointers! I had provider set to GLOBAL and require in UNIT. Maybe that's why. Let me take a look your example and follow your instructions here to give it another try. Thank you guys! On 06/07/2017 11:44 AM, Cory Johns wrote: Alex beat me to it, but here's a marginally

Re: How to count relations?

2017-06-07 Thread Cory Johns
Alex beat me to it, but here's a marginally more complete example: https://gist.github.com/johnsca/a91cb5897d92dfb6741ee1a09d82b39b The key points are: * The interface needs to be UNIT scoped (because you care about individual units) * The joined handler sets a state for each unit that joins *

How to count relations?

2017-06-07 Thread fengxia
Hi Juju, I'm building two charms and linking them with one relation, one charm ("A") will provide and the other ("B") will require. The deployment will have one "A" and three "B"s. How do I know all three Bs have joined? I'm thinking to use a counter in A's relation, then at relation-joined