These are chat archives for cloudsoft/brooklyn-tosca

16th
Dec 2015
Jose
@kiuby88
Dec 16 2015 09:41
Hi @/all
I am reviewing policies management and I found a question.
Do you think a policy could be described without a type? For example:
topology_template:
  description: Dynamic Cluster and a autoscaling policy
  node_templates:
    cluster:
      type: org.apache.brooklyn.entity.webapp.DynamicWebAppCluster

  # if you want to tell brooklyn to assign a location at deploy time, as part of the template, this is the current way.
  # it can also be done with camp, referencing this topology template.
  groups:
    add_brooklyn_location:
      members: [ ]
      policies:
      - test-policy:
          #type: org.apache.brooklyn.core.test.policy.TestPolicy
          policyLiteralValue1: Hello
          policyLiteralValue2: World
          test.confName: Name from YAML
          test.confFromFunction:  “$brooklyn:formatString(\”%s: is a fun place\”, \"$brooklyn\")"
If this is possible this if-else block will fail because the last if else will try to get the type
the solution is very simple (another condition and a &&)
can I open a PR to fix it?
Sam Corbett
@sjcorbett
Dec 16 2015 10:12
@kiuby88 The type of the policy must be given.
Do you have an example of a time when you think it is unnecessary?
Jose
@kiuby88
Dec 16 2015 10:19
I think as you. A policy must have a type.
I asked because a discussion was open by SeaClouds
but I think as you.
SeaClouds should add a type for each policy.
Thanks a lot
:)