Regardless of the outcome of the bug, the proper syntax for accessing units
is as follows:

self.d.sentry["ibm-mobilefirst-server"][0]

This is because, our new testing environment and soon to be normal testing
procedure for all charms while we wait for multi-model environments
recycles the environment and also incurs this increase. Either way,
hard-coded unit values tend to be fragile in general. This will do a look
up and always return the first unit. The previous hard-coded examples in
documentation are being updated to reflect this, I didn't realize how many
bad examples I'd produced over the years :)

Marco

On Fri, Nov 13, 2015 at 10:55 AM Matthew Williams <
matthew.willi...@canonical.com> wrote:

> Hi Sunitha,
>
> The bug is closed, it was fixed and released in juju 1.25.
>
> There are some docs at the below link that summarise the behaviour:
>
> https://jujucharms.com/docs/1.25/reference-numbering
>
> If you'd like to have a talk about this I'd be very happy to. I'm mattyw
> on irc in #juju and #juju-dev (otherwise email is fine)
>
> Thanks
>
> Matty
>
>
>
> On Fri, Nov 13, 2015 at 3:49 PM, Sunitha Radharapu <sradh...@in.ibm.com>
> wrote:
>
>> Hi Matt,
>>
>> I am a little bit confused here, bug description says it should be as
>> unique id. If it is a bug and you are going to fix in future juju releases
>> then we no need to change our amulet tests.
>>
>> If it is a new feature then we will change our upcoming charms
>> accordingly,
>>
>> Thanks,
>> Sunitha.
>>
>>
>>
>>
>> [image: Inactive hide details for Matthew Williams ---13-11-2015
>> 20:32:45---Hi Mark, Sunitha, My apologies, I should have included the]Matthew
>> Williams ---13-11-2015 20:32:45---Hi Mark, Sunitha, My apologies, I should
>> have included the explanation in the original email.
>>
>> From: Matthew Williams <matthew.willi...@canonical.com>
>> To: Mark Shuttleworth <m...@ubuntu.com>
>> Cc: Sunitha Radharapu/India/IBM@IBMIN, Juju email list <
>> juju@lists.ubuntu.com>
>> Date: 13-11-2015 20:32
>> Subject: Re: Unit number is increasing in latest juju version.
>> ------------------------------
>>
> Hi Mark, Sunitha,
>>
>> My apologies, I should have included the explanation in the original
>> email.
>>
>> This was a change to address a long standing bug:
>> *https://bugs.launchpad.net/juju-core/+bug/1174610*
>> <https://bugs.launchpad.net/juju-core/+bug/1174610>
>>
>> There's a discussion in the bug report, but the summary is that in most
>> cases it's desirable to have the unit id be unique across the life of an
>> environment. Otherwise you loose the identity of a unit across relations.
>>
>> We were already numbering the machines in the same way, so this change
>> also gives us consistency between machine and unit numbering systems.
>>
>> Thanks
>>
>> Matty
>>
>> On Fri, Nov 13, 2015 at 1:50 PM, Mark Shuttleworth <*m...@ubuntu.com*
>> <m...@ubuntu.com>> wrote:
>>
>>
>>    Thanks Sunitha. Matty, deeper question is - was this an intended
>>    change
>>    in behaviour, and what's the rationale?
>>
>>    Mark
>>
>>
>>
>> --
> Juju mailing list
> Juju@lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
-- 
Juju mailing list
Juju@lists.ubuntu.com
Modify settings or unsubscribe at: 
https://lists.ubuntu.com/mailman/listinfo/juju

Reply via email to