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
bf296b39
Commit
bf296b39
authored
Jun 01, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazonebs: panics in edge cases
parent
e629eef9
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
2 deletions
+20
-2
builder/amazonebs/builder.go
builder/amazonebs/builder.go
+20
-2
No files found.
builder/amazonebs/builder.go
View file @
bf296b39
...
@@ -47,7 +47,7 @@ func (b *Builder) Prepare(raw interface{}) (err error) {
...
@@ -47,7 +47,7 @@ func (b *Builder) Prepare(raw interface{}) (err error) {
// TODO: config validation and asking for fields:
// TODO: config validation and asking for fields:
// * access key
// * access key
// * secret key
// * secret key
// * region
// * region
(exists and valid)
// * source ami
// * source ami
// * instance type
// * instance type
// * SSH username
// * SSH username
...
@@ -57,8 +57,26 @@ func (b *Builder) Prepare(raw interface{}) (err error) {
...
@@ -57,8 +57,26 @@ func (b *Builder) Prepare(raw interface{}) (err error) {
}
}
func
(
b
*
Builder
)
Run
(
ui
packer
.
Ui
,
hook
packer
.
Hook
)
packer
.
Artifact
{
func
(
b
*
Builder
)
Run
(
ui
packer
.
Ui
,
hook
packer
.
Hook
)
packer
.
Artifact
{
// Basic sanity checks. These are panics now because the Prepare
// method should verify these exist and such.
if
b
.
config
.
AccessKey
==
""
{
panic
(
"access key not filled in"
)
}
if
b
.
config
.
SecretKey
==
""
{
panic
(
"secret key not filled in"
)
}
if
b
.
config
.
Region
==
""
{
panic
(
"region not filled in"
)
}
region
,
ok
:=
aws
.
Regions
[
b
.
config
.
Region
]
if
!
ok
{
panic
(
"region not found"
)
}
auth
:=
aws
.
Auth
{
b
.
config
.
AccessKey
,
b
.
config
.
SecretKey
}
auth
:=
aws
.
Auth
{
b
.
config
.
AccessKey
,
b
.
config
.
SecretKey
}
region
:=
aws
.
Regions
[
b
.
config
.
Region
]
ec2conn
:=
ec2
.
New
(
auth
,
region
)
ec2conn
:=
ec2
.
New
(
auth
,
region
)
// Setup the state bag and initial state for the steps
// Setup the state bag and initial state for the steps
...
...
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