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
8e46cd5c
Commit
8e46cd5c
authored
Jun 28, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
post-processor/vagrant: provider-specific config works
parent
f035b7a0
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
21 deletions
+31
-21
post-processor/vagrant/post-processor.go
post-processor/vagrant/post-processor.go
+19
-21
post-processor/vagrant/post-processor_test.go
post-processor/vagrant/post-processor_test.go
+12
-0
No files found.
post-processor/vagrant/post-processor.go
View file @
8e46cd5c
...
@@ -41,13 +41,12 @@ func (p *PostProcessor) Configure(raw interface{}) error {
...
@@ -41,13 +41,12 @@ func (p *PostProcessor) Configure(raw interface{}) error {
return
fmt
.
Errorf
(
"output invalid template: %s"
,
err
)
return
fmt
.
Errorf
(
"output invalid template: %s"
,
err
)
}
}
/*
var
mapConfig
map
[
string
]
interface
{}
TODO(mitchellh): We need a way to get the keys...
if
err
:=
mapstructure
.
Decode
(
raw
,
&
mapConfig
);
err
!=
nil
{
mapConfig, ok := raw.(map[string]interface{})
return
err
if !ok {
panic("Raw configuration not a map")
}
}
p
.
premade
=
make
(
map
[
string
]
packer
.
PostProcessor
)
errors
:=
make
([]
error
,
0
)
errors
:=
make
([]
error
,
0
)
for
k
,
raw
:=
range
mapConfig
{
for
k
,
raw
:=
range
mapConfig
{
pp
:=
keyToPostProcessor
(
k
)
pp
:=
keyToPostProcessor
(
k
)
...
@@ -65,7 +64,6 @@ func (p *PostProcessor) Configure(raw interface{}) error {
...
@@ -65,7 +64,6 @@ func (p *PostProcessor) Configure(raw interface{}) error {
if
len
(
errors
)
>
0
{
if
len
(
errors
)
>
0
{
return
&
packer
.
MultiError
{
errors
}
return
&
packer
.
MultiError
{
errors
}
}
}
*/
return
nil
return
nil
}
}
...
...
post-processor/vagrant/post-processor_test.go
View file @
8e46cd5c
...
@@ -35,3 +35,15 @@ func TestBuilderPrepare_OutputPath(t *testing.T) {
...
@@ -35,3 +35,15 @@ func TestBuilderPrepare_OutputPath(t *testing.T) {
t
.
Fatal
(
"should have error"
)
t
.
Fatal
(
"should have error"
)
}
}
}
}
func
TestBuilderPrepare_PPConfig
(
t
*
testing
.
T
)
{
var
p
PostProcessor
// Default
c
:=
testConfig
()
c
[
"aws"
]
=
map
[
string
]
interface
{}{}
err
:=
p
.
Configure
(
c
)
if
err
!=
nil
{
t
.
Fatalf
(
"err: %s"
,
err
)
}
}
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