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
97eb744c
Commit
97eb744c
authored
Jul 22, 2014
by
Henry Huang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
De-register the unavailable image in the cleanup
parent
43385a58
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
10 deletions
+10
-10
builder/amazon/ebs/step_create_ami.go
builder/amazon/ebs/step_create_ami.go
+10
-10
No files found.
builder/amazon/ebs/step_create_ami.go
View file @
97eb744c
...
@@ -34,15 +34,6 @@ func (s *stepCreateAMI) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -34,15 +34,6 @@ func (s *stepCreateAMI) Run(state multistep.StateBag) multistep.StepAction {
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
imagesResp
,
err
:=
ec2conn
.
Images
([]
string
{
createResp
.
ImageId
},
nil
)
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error searching for AMI: %s"
,
err
)
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
}
s
.
image
=
&
imagesResp
.
Images
[
0
]
// Set the AMI ID in the state
// Set the AMI ID in the state
ui
.
Message
(
fmt
.
Sprintf
(
"AMI: %s"
,
createResp
.
ImageId
))
ui
.
Message
(
fmt
.
Sprintf
(
"AMI: %s"
,
createResp
.
ImageId
))
amis
:=
make
(
map
[
string
]
string
)
amis
:=
make
(
map
[
string
]
string
)
...
@@ -65,11 +56,20 @@ func (s *stepCreateAMI) Run(state multistep.StateBag) multistep.StepAction {
...
@@ -65,11 +56,20 @@ func (s *stepCreateAMI) Run(state multistep.StateBag) multistep.StepAction {
return
multistep
.
ActionHalt
return
multistep
.
ActionHalt
}
}
imagesResp
,
err
:=
ec2conn
.
Images
([]
string
{
createResp
.
ImageId
},
nil
)
if
err
!=
nil
{
err
:=
fmt
.
Errorf
(
"Error searching for AMI: %s"
,
err
)
state
.
Put
(
"error"
,
err
)
ui
.
Error
(
err
.
Error
())
return
multistep
.
ActionHalt
}
s
.
image
=
&
imagesResp
.
Images
[
0
]
return
multistep
.
ActionContinue
return
multistep
.
ActionContinue
}
}
func
(
s
*
stepCreateAMI
)
Cleanup
(
state
multistep
.
StateBag
)
{
func
(
s
*
stepCreateAMI
)
Cleanup
(
state
multistep
.
StateBag
)
{
if
s
.
image
==
nil
{
if
s
.
image
==
nil
||
s
.
image
.
State
==
"available"
{
return
return
}
}
...
...
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