Open
Description
packerlicious version
1.2.4
I noticed in post_processor.py:
class PackerPostProcessorChain(BasePackerObject):
"""
TODO define what a chain is, see https://www.packer.io/docs/post-processors/artifice.html#configuration
for example
"""
Looking at how post processor chains, it's simply an additional array over the whole process. So instead of inside post_processor.py, how about in template.py, where:
def add_post_processor_chain(self, *args):
return self._update(self.post_processors, [args])
It makes it easier to add post-processor chains into the template. I'll post a pull request to this change.
Steps to reproduce
>>> from packerlicious import post_processor, Template
>>> test_template = Template()
>>> file_post = post_processor.Checksum()
>>> file_post2 = post_processor.Artifice(files = ['testfile.test'])
>>> test_template.add_post_processor_chain(file_post,file_post2)
>>> print(test_template.to_json())
{
"post-processors": [
# Notice the two arrays
[
{
"type": "checksum"
},
{
"files": [
"testfile.test"
],
"type": "artifice"
}
]
]
}
Metadata
Metadata
Assignees
Labels
No labels