Hi Richard.

I had to do the exact same thing for my PostgreSQL blueprint and the
solution was to wrap the `component("group").attributeWh
enReady("cluster.first.entity")` into a `$brooklyn:component()`[1].

I have to say, it was a surprise to me as well. I assumed it would just
worked by chaining the `attributeWhenReady` calls but apparently no. I
didn't mention it on the ML, nor created a ticket as the "workaround" was
pretty acceptable to me.

Hope this helps.

Cheers

[1]
https://github.com/brooklyncentral/brooklyn-postgresql/blob/master/catalog/postgresql.bom#L408

On Mon, 1 May 2017 at 15:26 Richard Downer <[email protected]> wrote:

> Hi all,
>
> In my blueprint, I have a group of MariaDBs, and I want to get the
> host.name
> of one entity in the group. The group exposes a sensor
> `cluster.first.entity`, so I want to get that entity, and then get its
> sensor `host.name`.
>
> Here's a fragment of my blueprint where I try to do this (reduced to as
> simple a blueprint as will demonstrate the problem):
>
>   - type:
> 'org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess:4.5.0'
>     location: localhost
>     brooklyn.config:
>       example: $brooklyn:formatString("mysql://%s",
>
> component("group").attributeWhenReady("cluster.first.entity").attributeWhenReady("
> host.name"))
>       install.command: echo $EXAMPLE
>       shell.env:
>         EXAMPLE: '$brooklyn:config("example")'
>
> So I would expect this to echo out a valid hostname, if I go into the
> Activity view and find the SSH task stdout.
>
> What I actually get is something like this:
>
>
> mysql://$brooklyn:entity(org.apache.brooklyn.camp.brooklyn.spi.dsl.methods.BrooklynDslCommon$DslFacades$EntitySupplier@30c91bfc
> ).attributeWhenReady("host.name")
>
> Is this kind of thing supposed to work? Am I doing something wrong?
>
> Thanks
> Richard.
>
-- 

Thomas Bouron • Senior Software Engineer @ Cloudsoft Corporation •
https://cloudsoft.io/
Github: https://github.com/tbouron
Twitter: https://twitter.com/eltibouron

Reply via email to