Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
f7585618
Commit
f7585618
authored
Aug 23, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post-processor/vagrant: don't error if unused
parent
0484006e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
post-processor/vagrant/post-processor.go
post-processor/vagrant/post-processor.go
+10
-11
No files found.
post-processor/vagrant/post-processor.go
View file @
f7585618
...
...
@@ -33,7 +33,7 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
// Store the raw configs for usage later
p
.
rawConfigs
=
raws
md
,
err
:=
common
.
DecodeConfig
(
&
p
.
config
,
raws
...
)
_
,
err
:=
common
.
DecodeConfig
(
&
p
.
config
,
raws
...
)
if
err
!=
nil
{
return
err
}
...
...
@@ -44,20 +44,18 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
}
tpl
.
UserVars
=
p
.
config
.
PackerUserVars
// Accumulate any errors
errs
:=
common
.
CheckUnusedConfig
(
md
)
// Defaults
ppExtraConfig
:=
make
(
map
[
string
]
interface
{})
if
p
.
config
.
OutputPath
==
""
{
p
.
config
.
OutputPath
=
"packer_{{ .BuildName }}_{{.Provider}}.box"
ppExtraConfig
[
"output"
]
=
p
.
config
.
OutputPath
}
// _, err := template.New("output").Parse(p.config.OutputPath)
// Accumulate any errors
errs
:=
new
(
packer
.
MultiError
)
if
err
:=
tpl
.
Validate
(
p
.
config
.
OutputPath
);
err
!=
nil
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Error parsing output template: %s"
,
err
))
return
errs
}
// Store the extra configuration for post-processors
...
...
@@ -66,11 +64,12 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
// TODO(mitchellh): Properly handle multiple raw configs
var
mapConfig
map
[
string
]
interface
{}
if
err
:=
mapstructure
.
Decode
(
raws
[
0
],
&
mapConfig
);
err
!=
nil
{
return
err
errs
=
packer
.
MultiErrorAppend
(
errs
,
fmt
.
Errorf
(
"Failed to decode config: %s"
,
err
))
return
errs
}
p
.
premade
=
make
(
map
[
string
]
packer
.
PostProcessor
)
errors
:=
make
([]
error
,
0
)
for
k
,
raw
:=
range
mapConfig
{
pp
:=
keyToPostProcessor
(
k
)
if
pp
==
nil
{
...
...
@@ -83,14 +82,14 @@ func (p *PostProcessor) Configure(raws ...interface{}) error {
ppConfigs
=
append
(
ppConfigs
,
raw
)
if
err
:=
pp
.
Configure
(
ppConfigs
...
);
err
!=
nil
{
err
ors
=
append
(
erro
rs
,
err
)
err
s
=
packer
.
MultiErrorAppend
(
er
rs
,
err
)
}
p
.
premade
[
k
]
=
pp
}
if
len
(
errors
)
>
0
{
return
&
packer
.
MultiError
{
errors
}
if
len
(
err
s
.
Err
ors
)
>
0
{
return
errs
}
return
nil
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment