[ 
https://issues.apache.org/jira/browse/BROOKLYN-454?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Duncan Godwin updated BROOKLYN-454:
-----------------------------------
    Description: 
Brooklyn seems to evaluate {{$brooklyn:config}} incorrectly in a latch. The 
following used to work in Apache Brooklyn 0.10.0 but no longer does:

{code}
location: localhost
services:
- type: org.apache.brooklyn.entity.stock.BasicApplication
  name: my-parent
  brooklyn.config:
    root.entity: $brooklyn:self()

  brooklyn.children:
  - type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
    name: my-child
    brooklyn.config:
      launch.command: echo Launching
      checkRunning.command: echo CheckRunning
      stop.command: echo Stopping
      launch.latch: 
$brooklyn:config("root.entity").attributeWhenReady("sensorInParent")
{code}

The following does work:

{code}
location: localhost
services:
- type: org.apache.brooklyn.entity.stock.BasicApplication
  name: my-parent
  brooklyn.config:
    root.entity: $brooklyn:self()

  brooklyn.children:
  - type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
    name: my-child
    brooklyn.initializers:
    - type: org.apache.brooklyn.core.sensor.StaticSensor
      brooklyn.config:
        name: root.entity
        targetType: org.apache.brooklyn.api.entity.Entity
        static.value: $brooklyn:config("root.entity")
    brooklyn.config:
      launch.command: echo Launching
      checkRunning.command: echo CheckRunning
      stop.command: echo Stopping
      launch.latch: 
$brooklyn:attributeWhenReady("root.entity").attributeWhenReady("sensorInParent")
{code}

  was:
Brooklyn seems to evaluate {{$brooklyn:config}} correctly in a latch when 
inheriting the value from a parent. The following used to work in Apache 
Brooklyn 0.10.0 but no longer does:

{code}
location: localhost
services:
- type: org.apache.brooklyn.entity.stock.BasicApplication
  name: my-parent
  brooklyn.config:
    root.entity: $brooklyn:self()

  brooklyn.children:
  - type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
    name: my-child
    brooklyn.config:
      launch.command: echo Launching
      checkRunning.command: echo CheckRunning
      stop.command: echo Stopping
      launch.latch: 
$brooklyn:config("root.entity").attributeWhenReady("sensorInParent")
{code}

The following does work:

{code}
location: localhost
services:
- type: org.apache.brooklyn.entity.stock.BasicApplication
  name: my-parent
  brooklyn.config:
    root.entity: $brooklyn:self()

  brooklyn.children:
  - type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
    name: my-child
    brooklyn.initializers:
    - type: org.apache.brooklyn.core.sensor.StaticSensor
      brooklyn.config:
        name: root.entity
        targetType: org.apache.brooklyn.api.entity.Entity
        static.value: $brooklyn:config("root.entity")
    brooklyn.config:
      launch.command: echo Launching
      checkRunning.command: echo CheckRunning
      stop.command: echo Stopping
      launch.latch: 
$brooklyn:attributeWhenReady("root.entity").attributeWhenReady("sensorInParent")
{code}


> Can't chain `$brooklyn:config("entity")` with subsequent DSL expressions
> ------------------------------------------------------------------------
>
>                 Key: BROOKLYN-454
>                 URL: https://issues.apache.org/jira/browse/BROOKLYN-454
>             Project: Brooklyn
>          Issue Type: Bug
>         Environment: Brooklyn 0.11.0-SNAPSHOT
>            Reporter: Duncan Godwin
>
> Brooklyn seems to evaluate {{$brooklyn:config}} incorrectly in a latch. The 
> following used to work in Apache Brooklyn 0.10.0 but no longer does:
> {code}
> location: localhost
> services:
> - type: org.apache.brooklyn.entity.stock.BasicApplication
>   name: my-parent
>   brooklyn.config:
>     root.entity: $brooklyn:self()
>   brooklyn.children:
>   - type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
>     name: my-child
>     brooklyn.config:
>       launch.command: echo Launching
>       checkRunning.command: echo CheckRunning
>       stop.command: echo Stopping
>       launch.latch: 
> $brooklyn:config("root.entity").attributeWhenReady("sensorInParent")
> {code}
> The following does work:
> {code}
> location: localhost
> services:
> - type: org.apache.brooklyn.entity.stock.BasicApplication
>   name: my-parent
>   brooklyn.config:
>     root.entity: $brooklyn:self()
>   brooklyn.children:
>   - type: org.apache.brooklyn.entity.software.base.VanillaSoftwareProcess
>     name: my-child
>     brooklyn.initializers:
>     - type: org.apache.brooklyn.core.sensor.StaticSensor
>       brooklyn.config:
>         name: root.entity
>         targetType: org.apache.brooklyn.api.entity.Entity
>         static.value: $brooklyn:config("root.entity")
>     brooklyn.config:
>       launch.command: echo Launching
>       checkRunning.command: echo CheckRunning
>       stop.command: echo Stopping
>       launch.latch: 
> $brooklyn:attributeWhenReady("root.entity").attributeWhenReady("sensorInParent")
> {code}



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Reply via email to