Do states have namespace?

Marco Ceppi marco.ceppi at canonical.com
Tue Apr 18 14:16:39 UTC 2017


No, because it's a sqlitedb per unit of charm. So a charm collocated on the
same machine will still have its own state.

Can I ask what you're looking to achieve?

Marco

On Tue, Apr 18, 2017, 10:05 fengxia <fxia1 at lenovo.com> wrote:

> Replying my own question:
>
> charmhelpers.core.unitdata shows how states are stored --
> "reactive.state.xyz" is saved in a sqlite3 as a string. So if split
> states in multiple charms, I think it will still work if deploying these
> charms to the same unit because they will be registered in the same DB.
>
> Can someone verify this?
>
> On 04/18/2017 08:50 AM, fengxia wrote:
> > I did a quick experiment:
> >
> > 1. Created two layers in one charm, each layer has a few states,
> > set_state() can trigger @when defined in other layers.
> >
> > 2. Use the same set of states, now splitting them in two charms =>
> > @when don't trigger anymore.
> >
> > So does this mean states have a namespace by the charm it belongs?
> >
>
> --
> Feng xia
> Engineer
> Lenovo USA
>
> Phone: 5088011794
> fxia1 at lenovo.com
>
> Lenovo.com
> Twitter | Facebook | Instagram | Blogs | Forums
>
>
> --
> Juju mailing list
> Juju at lists.ubuntu.com
> Modify settings or unsubscribe at:
> https://lists.ubuntu.com/mailman/listinfo/juju
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/juju/attachments/20170418/291bc115/attachment.html>


More information about the Juju mailing list