Skip to content

cloudinit with jinja2 templates are prefixed with a |\n #190

@sgel-msw

Description

@sgel-msw

Hi,

I believe:
https://github.com/cloudify-incubator/cloudify-utilities-plugin/blob/master/cloudify_cloudinit/__init__.py#L56`

f['content'] = '|\n' + new_content

Is incorrect and it should not include '|\n'.

I believe the intent was that

write-files:
  content: |
       string

would have been the result, but that is not what the code does. The code simply is prefixing the string with | as the first line. Simply by changing f['content'] = '|\n' + new_content to f['content'] = new_content should fix the issue in all cases as then the cloud-init write-file looks like this.

write-files:
  contnet: "{\"parameter\": \"value\"}"

and this is also valid.

I changed the code on my system and tested it but only with using the jinja2 templating functionality.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions