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
a7a51f1d
Commit
a7a51f1d
authored
Jun 27, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/amazonebs: Wait for instance to terminate during cleanup
parent
2a490887
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
5 additions
and
0 deletions
+5
-0
builder/amazonebs/step_run_source_instance.go
builder/amazonebs/step_run_source_instance.go
+4
-0
builder/amazonebs/step_security_group.go
builder/amazonebs/step_security_group.go
+1
-0
No files found.
builder/amazonebs/step_run_source_instance.go
View file @
a7a51f1d
...
...
@@ -65,5 +65,9 @@ func (s *stepRunSourceInstance) Cleanup(state map[string]interface{}) {
ui
.
Say
(
"Terminating the source AWS instance..."
)
if
_
,
err
:=
ec2conn
.
TerminateInstances
([]
string
{
s
.
instance
.
InstanceId
});
err
!=
nil
{
ui
.
Error
(
fmt
.
Sprintf
(
"Error terminating instance, may still be around: %s"
,
err
))
return
}
pending
:=
[]
string
{
"pending"
,
"running"
,
"shutting-down"
,
"stopped"
,
"stopping"
}
waitForState
(
ec2conn
,
s
.
instance
,
pending
,
"terminated"
)
}
builder/amazonebs/step_security_group.go
View file @
a7a51f1d
...
...
@@ -67,6 +67,7 @@ func (s *stepSecurityGroup) Cleanup(state map[string]interface{}) {
ui
.
Say
(
"Deleting temporary security group..."
)
_
,
err
:=
ec2conn
.
DeleteSecurityGroup
(
ec2
.
SecurityGroup
{
Id
:
s
.
groupId
})
if
err
!=
nil
{
log
.
Printf
(
"Error deleting security group: %s"
,
err
)
ui
.
Error
(
fmt
.
Sprintf
(
"Error cleaning up security group. Please delete the group manually: %s"
,
s
.
groupId
))
}
...
...
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