mitchellh/packer — pull request #1597 by petrhosek (2014-10-17 10:23:15+00:00)
Title: Extract Vagrant provider processing logic to a method

This change extracts the provider processing logic to a separate method which can be invoked from a subtype, providing a custom provider.

External builders (e.g. [packer-cloudstack](https://github.com/klarna/packer-cloudstack)) can enable Vagrant support by subtyping `vagrant.PostProcessor` and invoking the new method:

```go
type PostProcessor struct {
vagrant.PostProcessor
}

func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (packer.Artifact, bool, error) {
if artifact.BuilderId() != "mindjiver.cloudstack" {
return p.PostProcessor.PostProcess(ui, artifact)
}

return p.PostProcessor.PostProcessProvider("cloudstack", new(CloudStackProvider), ui, artifact)
}
```