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
d8b04866
Commit
d8b04866
authored
Aug 31, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/digitalocean: retry destroy a few times
parent
977969a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
4 deletions
+14
-4
CHANGELOG.md
CHANGELOG.md
+2
-0
builder/digitalocean/step_create_droplet.go
builder/digitalocean/step_create_droplet.go
+12
-4
No files found.
CHANGELOG.md
View file @
d8b04866
...
@@ -20,6 +20,8 @@ BUG FIXES:
...
@@ -20,6 +20,8 @@ BUG FIXES:
*
core: Concurrent map access is completely gone, fixing rare issues
*
core: Concurrent map access is completely gone, fixing rare issues
with runtime memory corruption. [GH-307]
with runtime memory corruption. [GH-307]
*
core: Fix possible panic when ctrl-C during provisioner run.
*
core: Fix possible panic when ctrl-C during provisioner run.
*
builder/digitalocean: Retry destroy a few times because DO sometimes
gives false errors.
*
provisioners/salt-masterless: Use filepath join to properly join paths.
*
provisioners/salt-masterless: Use filepath join to properly join paths.
## 0.3.5 (August 28, 2013)
## 0.3.5 (August 28, 2013)
...
...
builder/digitalocean/step_create_droplet.go
View file @
d8b04866
...
@@ -62,12 +62,20 @@ func (s *stepCreateDroplet) Cleanup(state multistep.StateBag) {
...
@@ -62,12 +62,20 @@ func (s *stepCreateDroplet) Cleanup(state multistep.StateBag) {
log
.
Printf
(
"Sleeping for %v, event_delay"
,
c
.
RawEventDelay
)
log
.
Printf
(
"Sleeping for %v, event_delay"
,
c
.
RawEventDelay
)
time
.
Sleep
(
c
.
eventDelay
)
time
.
Sleep
(
c
.
eventDelay
)
err
:=
client
.
DestroyDroplet
(
s
.
dropletId
)
var
err
error
for
i
:=
0
;
i
<
5
;
i
++
{
curlstr
:=
fmt
.
Sprintf
(
"curl '%v/droplets/%v/destroy?client_id=%v&api_key=%v'"
,
err
=
client
.
DestroyDroplet
(
s
.
dropletId
)
DIGITALOCEAN_API_URL
,
s
.
dropletId
,
c
.
ClientID
,
c
.
APIKey
)
if
err
==
nil
{
break
}
time
.
Sleep
(
2
*
time
.
Second
)
}
if
err
!=
nil
{
if
err
!=
nil
{
curlstr
:=
fmt
.
Sprintf
(
"curl '%v/droplets/%v/destroy?client_id=%v&api_key=%v'"
,
DIGITALOCEAN_API_URL
,
s
.
dropletId
,
c
.
ClientID
,
c
.
APIKey
)
ui
.
Error
(
fmt
.
Sprintf
(
ui
.
Error
(
fmt
.
Sprintf
(
"Error destroying droplet. Please destroy it manually: %v"
,
curlstr
))
"Error destroying droplet. Please destroy it manually: %v"
,
curlstr
))
}
}
...
...
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