Add 'none' option to 'format'

This commit is contained in:
Cheng Sun 2015-01-07 10:40:01 +00:00
parent 422028bb3c
commit fc6c922f47
3 changed files with 10 additions and 5 deletions

View File

@ -213,9 +213,9 @@ func (c *CommonConfig) Prepare(t *packer.ConfigTemplate, pc *common.PackerConfig
}
switch c.Format {
case "xva", "vdi_raw":
case "xva", "vdi_raw", "none":
default:
errs = append(errs, errors.New("format must be one of 'xva', 'vdi_raw'"))
errs = append(errs, errors.New("format must be one of 'xva', 'vdi_raw', 'none'"))
}
switch c.KeepVM {

View File

@ -56,6 +56,10 @@ func (StepExport) Run(state multistep.StateBag) multistep.StepAction {
ui.Say("Step: export artifact")
switch config.Format {
case "none":
ui.Say("Skipping export")
return multistep.ActionContinue
case "xva":
// export the VM

View File

@ -113,9 +113,10 @@ each category, the available options are alphabetized and described.
characters (\*, ?, and []) are allowed. Directory names are also allowed,
which will add all the files found in the directory to the floppy.
* `format` (string) - Either "xva" or "vdi_raw", this specifies the output
format of the exported virtual machine. This defaults to "xva". Set to
"vdi_raw" to export just the raw disk image.
* `format` (string) - Either "xva", "vdi_raw" or "none", this specifies the
output format of the exported virtual machine. This defaults to "xva". Set to
"vdi_raw" to export just the raw disk image. Set to "none" to export nothing;
this is only useful with "keep_vm" set to "always" or "on_success".
* `http_directory` (string) - Path to a directory to serve using an HTTP
server. The files in this directory will be available over HTTP that will