@ -17,14 +17,13 @@ type Config struct {
AccountFile string ` mapstructure:"account_file" `
DiskSizeGb int64 ` mapstructure:"disk_size" `
DiskType string ` mapstructure:"disk_type" `
KeepOriginalImage bool ` mapstructure:"keep_input_artifact" `
MachineType string ` mapstructure:"machine_type" `
Network string ` mapstructure:"network" `
Paths [ ] string ` mapstructure:"paths" `
Subnetwork string ` mapstructure:"subnetwork" `
Zone string ` mapstructure:"zone" `
DiskSizeGb int64 ` mapstructure:"disk_size" `
DiskType string ` mapstructure:"disk_type" `
MachineType string ` mapstructure:"machine_type" `
Network string ` mapstructure:"network" `
Paths [ ] string ` mapstructure:"paths" `
Subnetwork string ` mapstructure:"subnetwork" `
Zone string ` mapstructure:"zone" `
Account googlecompute . AccountFile
ctx interpolate . Context
@ -80,7 +79,7 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
err := fmt . Errorf (
"Unknown artifact type: %s\nCan only export from Google Compute Engine builder artifacts." ,
artifact . BuilderId ( ) )
return nil , p . config . KeepOriginalImag e, false , err
return nil , fals e, false , err
}
builderAccountFile := artifact . State ( "AccountFilePath" ) . ( string )
@ -98,13 +97,13 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
if builderAccountFile != "" {
err := googlecompute . ProcessAccountFile ( & p . config . Account , builderAccountFile )
if err != nil {
return nil , p . config . KeepOriginalImag e, false , err
return nil , fals e, false , err
}
}
if p . config . AccountFile != "" {
err := googlecompute . ProcessAccountFile ( & p . config . Account , p . config . AccountFile )
if err != nil {
return nil , p . config . KeepOriginalImag e, false , err
return nil , fals e, false , err
}
}
@ -141,7 +140,7 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
driver , err := googlecompute . NewDriverGCE ( ui , builderProjectId , & p . config . Account )
if err != nil {
return nil , p . config . KeepOriginalImag e, false , err
return nil , fals e, false , err
}
// Set up the state.
@ -169,5 +168,5 @@ func (p *PostProcessor) PostProcess(ui packer.Ui, artifact packer.Artifact) (pac
result := & Artifact { paths : p . config . Paths }
return result , p . config . KeepOriginalImag e, false , nil
return result , fals e, false , nil
}