New Question

jimmycliff's profile - activity

2016-11-12 03:53:12 +0300 received badge  Famous Question (source)
2016-06-03 19:55:34 +0300 received badge  Notable Question (source)
2016-04-21 14:16:22 +0300 received badge  Popular Question (source)
2016-04-20 15:40:59 +0300 received badge  Editor (source)
2016-04-14 15:20:56 +0300 asked a question cloudbase init encoding for write_files

I would gladly provide code to fix this issue - do you accept PRs? Thought about moving to github for issue tracking,etc? :)


I am having issues with cloudbase init where there does not seem to be a method/workflow of delivering txt to a VM. It appears that cloud-config in Userdata should do this, but I am running into issues with encoding. The documentation suggests that encoding is required, however the actual code says that it is optional.

Link to code and snip below:

"""Plugin for writing files on the filesystem. It can process either a list of files or only one file, where the file is represented by a dictionary, which can contain the following keys: path: The absolute path to the location on the filesystem where the file should be written. content: The content that should be placed in the file. owner: The user account and group that should be given ownership of the file. permissions: The octal permissions set that should be given for this file. encoding: An optional encoding specification for the file. The only required keys in this dictionary are path and content. """

If you do not specify encoding it will write file however you will get an error:

ERROR cloudbaseinit.plugins.common.userdataplugins.cloudconfigplugins.write_files [-] Unknown encoding, doing nothing.

It seems like a very standard workflow to pass txt via userdata. There are a ton of examples on the internet. The non base cloudinit handles it as expected.

Would you agree this is a bug in cloudbase init? Is there a suggested way of passing txt via userdata.