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
fc390422
Commit
fc390422
authored
Jul 25, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazon/instance: default x509_upload_path
parent
321d1cce
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
6 deletions
+6
-6
builder/amazon/instance/builder.go
builder/amazon/instance/builder.go
+4
-4
builder/amazon/instance/builder_test.go
builder/amazon/instance/builder_test.go
+2
-2
No files found.
builder/amazon/instance/builder.go
View file @
fc390422
...
@@ -81,6 +81,10 @@ func (b *Builder) Prepare(raws ...interface{}) error {
...
@@ -81,6 +81,10 @@ func (b *Builder) Prepare(raws ...interface{}) error {
"--batch"
"--batch"
}
}
if
b
.
config
.
X509UploadPath
==
""
{
b
.
config
.
X509UploadPath
=
"/tmp"
}
// Accumulate any errors
// Accumulate any errors
errs
:=
common
.
CheckUnusedConfig
(
md
)
errs
:=
common
.
CheckUnusedConfig
(
md
)
errs
=
packer
.
MultiErrorAppend
(
errs
,
b
.
config
.
AccessConfig
.
Prepare
()
...
)
errs
=
packer
.
MultiErrorAppend
(
errs
,
b
.
config
.
AccessConfig
.
Prepare
()
...
)
...
@@ -121,10 +125,6 @@ func (b *Builder) Prepare(raws ...interface{}) error {
...
@@ -121,10 +125,6 @@ func (b *Builder) Prepare(raws ...interface{}) error {
errs
,
fmt
.
Errorf
(
"x509_key_path points to bad file: %s"
,
err
))
errs
,
fmt
.
Errorf
(
"x509_key_path points to bad file: %s"
,
err
))
}
}
if
b
.
config
.
X509UploadPath
==
""
{
errs
=
packer
.
MultiErrorAppend
(
errs
,
errors
.
New
(
"x509_upload_path is required"
))
}
if
errs
!=
nil
&&
len
(
errs
.
Errors
)
>
0
{
if
errs
!=
nil
&&
len
(
errs
.
Errors
)
>
0
{
return
errs
return
errs
}
}
...
...
builder/amazon/instance/builder_test.go
View file @
fc390422
...
@@ -213,7 +213,7 @@ func TestBuilderPrepare_X509UploadPath(t *testing.T) {
...
@@ -213,7 +213,7 @@ func TestBuilderPrepare_X509UploadPath(t *testing.T) {
config
[
"x509_upload_path"
]
=
""
config
[
"x509_upload_path"
]
=
""
err
:=
b
.
Prepare
(
config
)
err
:=
b
.
Prepare
(
config
)
if
err
=
=
nil
{
if
err
!
=
nil
{
t
.
Fatal
(
"should have error"
)
t
.
Fatal
f
(
"should not have error: %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