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
1df07357
Commit
1df07357
authored
Sep 04, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
builder/digitalocean: retry longer and don't retry shutdown
parent
362c3201
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
12 deletions
+2
-12
builder/digitalocean/step_create_droplet.go
builder/digitalocean/step_create_droplet.go
+1
-11
builder/digitalocean/step_shutdown.go
builder/digitalocean/step_shutdown.go
+1
-1
No files found.
builder/digitalocean/step_create_droplet.go
View file @
1df07357
...
...
@@ -6,7 +6,6 @@ import (
"fmt"
"github.com/mitchellh/multistep"
"github.com/mitchellh/packer/packer"
"time"
)
type
stepCreateDroplet
struct
{
...
...
@@ -55,16 +54,7 @@ func (s *stepCreateDroplet) Cleanup(state multistep.StateBag) {
// Destroy the droplet we just created
ui
.
Say
(
"Destroying droplet..."
)
var
err
error
for
i
:=
0
;
i
<
5
;
i
++
{
err
=
client
.
DestroyDroplet
(
s
.
dropletId
)
if
err
==
nil
{
break
}
time
.
Sleep
(
2
*
time
.
Second
)
}
err
:=
client
.
DestroyDroplet
(
s
.
dropletId
)
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
)
...
...
builder/digitalocean/step_shutdown.go
View file @
1df07357
...
...
@@ -61,7 +61,7 @@ func (s *stepShutdown) Run(state multistep.StateBag) multistep.StepAction {
}
}()
err
=
waitForDropletState
(
"off"
,
dropletId
,
client
,
2
*
time
.
Minute
)
err
=
waitForDropletState
(
"off"
,
dropletId
,
client
,
2
*
time
.
Minute
)
if
err
!=
nil
{
log
.
Printf
(
"Error waiting for graceful off: %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