OSDir


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Openstack] compiler for heat templates


Hi

Is there a way to check heat templates. At the moment I run one and it
errors at runtime when, for example an something expects a string but gets
a list. For example in this case of an OS::Heat::SoftwareConfig resource,
the config attribute below expects a string, which is why str_replace works

 some_resource:
      type: OS::Heat::SoftwareConfig
      properties:
        config:
          str_replace:
            params:
              $repstr$:
                list_join: ['-', [ {get_param: cluster_name}, 'xyz']]
            template: |
              #!/bin/bash
              echo $repstr$ >> /etc/somefile

According to this
https://docs.openstack.org/heat/latest/template_guide/openstack.html#OS::Heat::SoftwareConfig

the config property expects a string.

If I replace str_replace with something that generates a list (e.g. repeat)
it fails at runtime. Is there a way to type check this? I tried 'heat
template-validate' but it didn't do what I expected...
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack/attachments/20180320/07619f32/attachment.html>